From 63b442977597bb049f4e1ec89bfb293d42324828 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 22 Apr 2020 14:23:24 +0200 Subject: [PATCH 01/25] Escape clashing model names (#6004) Closes #6002 --- .../languages/TypeScriptFetchClientCodegen.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 b1ab5e4fa8..a2f03cfdd3 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 @@ -235,9 +235,24 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.updateOperationParameterEnumInformation(operations); this.addOperationObjectResponseInformation(operations); this.addOperationPrefixParameterInterfacesInformation(operations); + this.escapeOperationIds(operations); return operations; } + private void escapeOperationIds(Map operations) { + Map _operations = (Map) operations.get("operations"); + List operationList = (List) _operations.get("operation"); + for (CodegenOperation op : operationList) { + String param = op.operationIdCamelCase + "Request"; + if (op.imports.contains(param)) { + // we import a model with the same name as the generated operation, escape it + op.operationIdCamelCase += "Operation"; + op.operationIdLowerCase += "operation"; + op.operationIdSnakeCase += "_operation"; + } + } + } + private void addOperationModelImportInfomation(Map operations) { // This method will add extra infomation to the operations.imports array. // The api template uses this infomation to import all the required From b431d65099233e78ce19cde5f963aadc51ff2da9 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 22 Apr 2020 14:24:42 +0200 Subject: [PATCH 02/25] Make "Index" a reserved word (#6000) Some APIs have a model called "Index" which would create a file "Index.ts" which would override "index.ts" on case-insensitive file systems (e.g. macOS, some Windows versions). Make "Index" a reserved word to prevent this clash. --- docs/generators/typescript-fetch.md | 1 + .../codegen/languages/TypeScriptFetchClientCodegen.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index af3dd91626..40e7ff4eb2 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -76,6 +76,7 @@ sidebar_label: typescript-fetch
  • HTTPHeaders
  • HTTPMethod
  • HTTPQuery
  • +
  • Index
  • JSONApiResponse
  • Middleware
  • ModelPropertyNaming
  • 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 a2f03cfdd3..38b3f71ac6 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 @@ -327,6 +327,9 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.reservedWords.add("VoidApiResponse"); this.reservedWords.add("BlobApiResponse"); this.reservedWords.add("TextApiResponse"); + // "Index" would create a file "Index.ts" which on case insensitive filesystems + // would override our "index.js" file + this.reservedWords.add("Index"); } private boolean getUseSingleRequestParameter() { From 00ffcea6ef13a89d49ce3f4bb768e3a2e8df8dfb Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Wed, 22 Apr 2020 14:25:26 +0200 Subject: [PATCH 03/25] [typescript-fetch] Fix map API return type (#5995) Fix APIs that return a map. --- .../src/main/resources/typescript-fetch/apis.mustache | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 881f1b7ab5..ace07d5b96 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -290,7 +290,12 @@ export class {{classname}} extends runtime.BaseAPI { return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map({{returnBaseType}}FromJSON)); {{/isListContainer}} {{^isListContainer}} + {{#isMapContainer}} + return new runtime.JSONApiResponse(response, (jsonValue) => runtime.mapValues(jsonValue, {{returnBaseType}}FromJSON)); + {{/isMapContainer}} + {{^isMapContainer}} return new runtime.JSONApiResponse(response, (jsonValue) => {{returnBaseType}}FromJSON(jsonValue)); + {{/isMapContainer}} {{/isListContainer}} {{/returnTypeIsPrimitive}} {{/isResponseFile}} From 140f8234652671eb0f287512ddfd99b9f207f7c5 Mon Sep 17 00:00:00 2001 From: chenqping <5651810+chenqping@users.noreply.github.com> Date: Thu, 23 Apr 2020 13:31:42 +0800 Subject: [PATCH 04/25] fix generate java-inflector crash issue on windows (#6011) --- .../openapitools/codegen/languages/AbstractJavaCodegen.java | 2 +- .../openapitools/codegen/languages/GroovyClientCodegen.java | 2 +- .../openapitools/codegen/languages/JavaCXFClientCodegen.java | 2 +- .../codegen/languages/JavaInflectorServerCodegen.java | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) 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 5d9c5be398..c516814b8d 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 @@ -82,7 +82,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected String licenseUrl = "http://unlicense.org"; protected String projectFolder = "src/main"; protected String projectTestFolder = "src/test"; - protected String sourceFolder = projectFolder + "/java"; + protected String sourceFolder = projectFolder + File.separator +"java"; protected String testFolder = projectTestFolder + "/java"; protected boolean fullJavaUtil; protected boolean discriminatorCaseSensitive = true; // True if the discriminator value lookup should be case-sensitive. 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 1066f2294b..95b11793cd 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 @@ -60,7 +60,7 @@ public class GroovyClientCodegen extends AbstractJavaCodegen { languageSpecificPrimitives.add("File"); languageSpecificPrimitives.add("Map"); - sourceFolder = projectFolder + "/groovy"; + sourceFolder = projectFolder + File.separator +"groovy"; outputFolder = "generated-code/groovy"; modelTemplateFiles.put("model.mustache", ".groovy"); apiTemplateFiles.put("api.mustache", ".groovy"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java index bb206b12f6..14a83fa21e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCXFClientCodegen.java @@ -54,7 +54,7 @@ public class JavaCXFClientCodegen extends AbstractJavaCodegen supportsInheritance = true; - sourceFolder = "src/gen/java"; + sourceFolder = "src"+ File.separator +"gen"+ File.separator +"java"; invokerPackage = "org.openapitools.api"; artifactId = "openapi-jaxrs-client"; dateLibrary = "legacy"; //TODO: add joda support to all jax-rs diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java index 97c7bdb50b..23036b61e7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaInflectorServerCodegen.java @@ -26,6 +26,7 @@ import org.openapitools.codegen.meta.features.DocumentationFeature; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.File; import java.util.*; import static org.openapitools.codegen.utils.StringUtils.camelize; @@ -43,7 +44,7 @@ public class JavaInflectorServerCodegen extends AbstractJavaCodegen { modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme)); - sourceFolder = "src/gen/java"; + sourceFolder = "src"+ File.separator+"gen"+ File.separator +"java"; apiTestTemplateFiles.clear(); // TODO: add test template embeddedTemplateDir = templateDir = "JavaInflector"; invokerPackage = "org.openapitools.controllers"; From c981535579332baa94ccdb1e60c408eba5c172cc Mon Sep 17 00:00:00 2001 From: "Francisco A. Lozano" Date: Thu, 23 Apr 2020 17:25:35 +0200 Subject: [PATCH 05/25] Change access updateParamsForAuth to protected (#5940) So that it can be overridden with a custom behaviour. --- .../resources/Java/libraries/resttemplate/ApiClient.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index b160b7cca2..a2e66a62b6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -716,7 +716,7 @@ public class ApiClient { * @param queryParams The query parameters * @param headerParams The header parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { From 4ed3421a77255e4a25fe41e60713e257e4b1d8ec Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 23 Apr 2020 23:32:47 +0800 Subject: [PATCH 06/25] update resttemplate sample --- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- .../src/main/java/org/openapitools/client/ApiClient.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java index 74cb867343..cfdc5b1b8c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java @@ -702,7 +702,7 @@ public class ApiClient { * @param queryParams The query parameters * @param headerParams The header parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java index 0be41bbbf7..8220b56a30 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java @@ -689,7 +689,7 @@ public class ApiClient { * @param queryParams The query parameters * @param headerParams The header parameters */ - private void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { + protected void updateParamsForAuth(String[] authNames, MultiValueMap queryParams, HttpHeaders headerParams, MultiValueMap cookieParams) { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { From bafed337b51c5941802ad856c40fabc31e2f4dd2 Mon Sep 17 00:00:00 2001 From: iliaskarim Date: Thu, 23 Apr 2020 22:36:52 -0400 Subject: [PATCH 07/25] Fix OpenAPI link in broken Swift4/5 README templates (#6035) * Fix Swift README templates * Update Swift4/5 samples --- .../src/main/resources/swift4/README.mustache | 2 +- .../src/main/resources/swift5/README.mustache | 2 +- .../swift4/default/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../client/petstore/swift4/default/README.md | 2 +- .../nonPublicApi/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../petstore/swift4/nonPublicApi/README.md | 2 +- .../objcCompatible/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../petstore/swift4/objcCompatible/README.md | 2 +- .../.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../swift4/promisekitLibrary/README.md | 2 +- .../resultLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../petstore/swift4/resultLibrary/README.md | 2 +- .../rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../petstore/swift4/rxswiftLibrary/README.md | 2 +- .../unwrapRequired/.openapi-generator/VERSION | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 2 - .../petstore/swift4/unwrapRequired/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../swift5/alamofireLibrary/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../petstore/swift5/combineLibrary/README.md | 2 +- .../petstore/swift5/default/Package.swift | 4 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 +++--- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 ++- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 ++-- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 - .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 - .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 - .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 178 +++++++++--------- .../client/petstore/swift5/default/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../petstore/swift5/nonPublicApi/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../petstore/swift5/objcCompatible/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../swift5/promisekitLibrary/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 +-- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 +- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../petstore/swift5/resultLibrary/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../petstore/swift5/rxswiftLibrary/README.md | 2 +- .../PetstoreClient.xcodeproj/project.pbxproj | 5 +- .../contents.xcworkspacedata | 2 +- .../xcschemes/PetstoreClient.xcscheme | 6 + .../Classes/OpenAPIs/APIs.swift | 2 +- .../Classes/OpenAPIs/CodableHelper.swift | 8 +- .../OpenAPIs/URLSessionImplementations.swift | 6 +- .../swift5/urlsessionLibrary/README.md | 2 +- 144 files changed, 474 insertions(+), 533 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift4/README.mustache b/modules/openapi-generator/src/main/resources/swift4/README.mustache index da90d5e1b4..c62117517e 100644 --- a/modules/openapi-generator/src/main/resources/swift4/README.mustache +++ b/modules/openapi-generator/src/main/resources/swift4/README.mustache @@ -5,7 +5,7 @@ {{/appDescriptionWithNewLines}} ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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}} diff --git a/modules/openapi-generator/src/main/resources/swift5/README.mustache b/modules/openapi-generator/src/main/resources/swift5/README.mustache index 6ee7cf37af..3e3ff43b9f 100644 --- a/modules/openapi-generator/src/main/resources/swift5/README.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/README.mustache @@ -5,7 +5,7 @@ {{/appDescriptionWithNewLines}} ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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}} diff --git a/samples/client/petstore/swift4/default/.openapi-generator/VERSION b/samples/client/petstore/swift4/default/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/default/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj index 94b4f45130..b606fe1ab1 100644 --- a/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj @@ -299,8 +299,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/default/README.md b/samples/client/petstore/swift4/default/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/default/README.md +++ b/samples/client/petstore/swift4/default/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj index 94b4f45130..b606fe1ab1 100644 --- a/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj @@ -299,8 +299,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/nonPublicApi/README.md b/samples/client/petstore/swift4/nonPublicApi/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/nonPublicApi/README.md +++ b/samples/client/petstore/swift4/nonPublicApi/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj index 94b4f45130..b606fe1ab1 100644 --- a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj @@ -299,8 +299,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/objcCompatible/README.md b/samples/client/petstore/swift4/objcCompatible/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/objcCompatible/README.md +++ b/samples/client/petstore/swift4/objcCompatible/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj index 6b9213511f..c2e0485066 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -303,8 +303,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/promisekitLibrary/README.md b/samples/client/petstore/swift4/promisekitLibrary/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/promisekitLibrary/README.md +++ b/samples/client/petstore/swift4/promisekitLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj index e8707f0ff9..49e6ca81fd 100644 --- a/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -302,8 +302,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/resultLibrary/README.md b/samples/client/petstore/swift4/resultLibrary/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/resultLibrary/README.md +++ b/samples/client/petstore/swift4/resultLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj index c749d2778d..43e65668d5 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -303,8 +303,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/rxswiftLibrary/README.md b/samples/client/petstore/swift4/rxswiftLibrary/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/rxswiftLibrary/README.md +++ b/samples/client/petstore/swift4/rxswiftLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION index bfbf77eb7f..b5d898602c 100644 --- a/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION +++ b/samples/client/petstore/swift4/unwrapRequired/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0-SNAPSHOT \ No newline at end of file +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj index 94b4f45130..b606fe1ab1 100644 --- a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.pbxproj @@ -299,8 +299,6 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; diff --git a/samples/client/petstore/swift4/unwrapRequired/README.md b/samples/client/petstore/swift4/unwrapRequired/README.md index e00b3c99d2..bd093317bd 100644 --- a/samples/client/petstore/swift4/unwrapRequired/README.md +++ b/samples/client/petstore/swift4/unwrapRequired/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj index a03104894c..5a3cb5019c 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,14 +305,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -568,7 +567,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/README.md b/samples/client/petstore/swift5/alamofireLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/README.md +++ b/samples/client/petstore/swift5/alamofireLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/combineLibrary/README.md b/samples/client/petstore/swift5/combineLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/combineLibrary/README.md +++ b/samples/client/petstore/swift5/combineLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/default/Package.swift b/samples/client/petstore/swift5/default/Package.swift index 79f6f81887..96dfff54ed 100644 --- a/samples/client/petstore/swift5/default/Package.swift +++ b/samples/client/petstore/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]), + targets: ["PetstoreClient"]) ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ), + ) ] ) diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + [String:Any]? { + public 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 @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + public 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: ",") + if let collection = item.value as? [Any?] { + result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") } else if let value: Any = item.value { result[item.key] = "\(value)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? Array { + if let collection = source as? [Any?] { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + public 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 { + if let collection = item.value as? [Any?] { let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") result.append(URLQueryItem(name: item.key, value: value)) } else if let value = item.value { @@ -68,4 +68,3 @@ public struct APIHelper { return destination } } - diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index c5d1b9b42d..a5c2d605df 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String:String] = [:] + public static var customHeaders: [String: String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String:String] - public let parameters: [String:Any]? + var headers: [String: String] + public let parameters: [String: Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> ())? + public var onProgressReady: ((Progress) -> Void)? - required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders:[String:String]) { + open func addHeaders(_ aHeaders: [String: String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bb3ae71782..5bbf323f82 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class AnotherFakeAPI { /** To test special tags @@ -17,7 +15,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index d1d81faa33..134d6aea41 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeAPI { /** @@ -16,7 +14,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -51,7 +49,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -86,7 +84,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -121,7 +119,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -156,7 +154,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -192,7 +190,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -231,7 +229,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -281,7 +279,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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(apiResponseQueue) { result -> Void in switch result { case .success: @@ -318,7 +316,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -337,7 +335,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -426,7 +424,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -454,19 +452,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -492,7 +490,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -518,13 +516,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -545,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -562,7 +560,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -582,7 +580,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -603,14 +601,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index d21c4a49d4..48cfe7187b 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,8 +7,6 @@ import Foundation - - open class FakeClassnameTags123API { /** To test class name in snake case @@ -17,7 +15,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 496da91171..0552d4a6c1 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class PetAPI { /** Add a new pet to the store @@ -17,7 +15,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -57,7 +55,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -84,8 +82,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -113,7 +111,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -137,8 +135,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -156,7 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -180,8 +178,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -199,7 +197,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,8 +224,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -242,7 +240,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -283,7 +281,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -311,14 +309,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -335,7 +333,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -363,14 +361,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -387,7 +385,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -415,14 +413,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String:Any?] = [ + let formParams: [String: Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 3848eda85a..a8a83eda39 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class StoreAPI { /** Delete purchase order by ID @@ -17,7 +15,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -41,8 +39,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -56,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -76,14 +74,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -95,7 +93,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,8 +117,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -135,7 +133,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 546166841d..505ed1b0c5 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,8 +7,6 @@ import Foundation - - open class UserAPI { /** Create user @@ -17,7 +15,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +52,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -90,7 +88,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -126,7 +124,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -150,8 +148,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -166,7 +164,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -189,8 +187,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -206,7 +204,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -228,11 +226,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -247,7 +245,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -266,8 +264,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String:Any]? = nil - + let parameters: [String: Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -283,7 +281,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 01b28a4bd4..ef971ebadc 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} \ No newline at end of file +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index f171525e43..627d9adb75 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open 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. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} \ No newline at end of file + +} 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 6e279679c6..93ed6b90b3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { - var tmpArray: [T]? = nil + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { + var tmpArray: [T]? if contains(key) { tmpArray = try decodeArray(T.self, forKey: key) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { - var map: [Self.Key : T] = [:] + public 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) { @@ -177,5 +177,3 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } - - diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index 08f1ef334d..b79e9f5e64 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? = nil + var returnedParams: [String: Any]? if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 314f1eff1f..02f78ffb47 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? = nil + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? = nil + var params: [String: Any]? if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 290c7f35e4..b0bfb11597 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse : Error { +public enum ErrorResponse: Error { case error(Int, Data?, Error) } -public enum DownloadException : Error { +public enum DownloadException: Error { case responseDataMissing case responseFailed case requestMissing @@ -30,7 +30,6 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } - open class Response { public let statusCode: Int public let header: [String: String] @@ -44,7 +43,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String:String]() + var header = [String: String]() for (key, value) in rawHeader { if let key = key as? String, let value = value as? String { header[key] = value 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 28ca8377b8..1af0315359 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 @@ -7,19 +7,17 @@ import Foundation +public struct AdditionalPropertiesClass: Codable { -public struct AdditionalPropertiesClass: Codable { + public var mapString: [String: String]? + public var mapMapString: [String: [String: String]]? - - public var mapString: [String:String]? - public var mapMapString: [String:[String:String]]? - - public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { + public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_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 1050d79dbe..5ed9f31e2a 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Animal: Codable { - +public struct Animal: Codable { public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e7bea63f8e..e09b0e9efd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,5 +7,4 @@ import Foundation - public typealias AnimalFarm = [Animal] 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 4d0393b9ba..ec270da890 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 @@ -7,9 +7,7 @@ import Foundation - -public struct ApiResponse: Codable { - +public struct ApiResponse: Codable { 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 1363c96394..6c252ed475 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 @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfArrayOfNumberOnly: Codable { - +public struct ArrayOfArrayOfNumberOnly: Codable { public var arrayArrayNumber: [[Double]]? @@ -17,7 +15,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } 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 6b8873730c..e84eb5d650 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 @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayOfNumberOnly: Codable { - +public struct ArrayOfNumberOnly: Codable { public var arrayNumber: [Double]? @@ -17,7 +15,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } 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 64f7c6d9db..d2140933d1 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 @@ -7,9 +7,7 @@ import Foundation - -public struct ArrayTest: Codable { - +public struct ArrayTest: Codable { public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -21,7 +19,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" 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 ddb669a590..d1b3b27616 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Capitalization: Codable { - +public struct Capitalization: Codable { public var smallCamel: String? public var capitalCamel: String? @@ -28,7 +26,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" 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 c4f6e0d488..7ab887f311 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Cat: Codable { - +public struct Cat: Codable { 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 7b1d7e32be..a51ad0dffa 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 @@ -7,9 +7,7 @@ import Foundation - -public struct CatAllOf: Codable { - +public struct CatAllOf: Codable { 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 3ec00f5ab1..eb8f7e5e19 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Category: Codable { - +public struct Category: Codable { 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 af030c3dd6..e2a7d4427a 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 @@ -8,8 +8,7 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { - +public struct ClassModel: Codable { 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 0aae748c76..00245ca372 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Client: Codable { - +public struct Client: Codable { 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 198e28b94d..492c122800 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Dog: Codable { - +public struct Dog: Codable { 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 8ff49b2af2..7786f8acc5 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 @@ -7,9 +7,7 @@ import Foundation - -public struct DogAllOf: Codable { - +public struct DogAllOf: Codable { 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 e2d3fa04f9..9844e7c40e 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 @@ -7,9 +7,7 @@ import Foundation - -public struct EnumArrays: Codable { - +public struct EnumArrays: Codable { public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -27,7 +25,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index c2c639ba32..d4029d73f8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,7 +7,6 @@ import Foundation - public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" 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 a56e1f3638..789f583e1d 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 @@ -7,9 +7,7 @@ import Foundation - -public struct EnumTest: Codable { - +public struct EnumTest: Codable { public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -43,7 +41,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" 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 773b53b2cb..abf3ccffc4 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 @@ -8,8 +8,7 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { - +public struct File: Codable { /** 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 83dc1148cf..532f145793 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 @@ -7,9 +7,7 @@ import Foundation - -public struct FileSchemaTestClass: Codable { - +public struct FileSchemaTestClass: Codable { 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 bccd3f9fb1..20bd6d103b 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 @@ -7,9 +7,7 @@ import Foundation - -public struct FormatTest: Codable { - +public struct FormatTest: Codable { 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 566d71a35e..906ddb06fb 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 @@ -7,9 +7,7 @@ import Foundation - -public struct HasOnlyReadOnly: Codable { - +public struct HasOnlyReadOnly: Codable { 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 80cecab242..fe13d302cc 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 @@ -7,9 +7,7 @@ import Foundation - -public struct List: Codable { - +public struct List: Codable { public var _123list: String? @@ -17,7 +15,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } 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 f0c02de95f..4b6037f378 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 @@ -7,27 +7,25 @@ import Foundation - -public struct MapTest: Codable { - +public struct MapTest: Codable { public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String:[String:String]]? - public var mapOfEnumString: [String:String]? - public var directMap: [String:Bool]? + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + public var directMap: [String: Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" 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 710e62a9b5..c3deb2f289 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 @@ -7,15 +7,13 @@ import Foundation - -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { - +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { public var uuid: UUID? public var dateTime: Date? - public var map: [String:Animal]? + public var map: [String: Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map 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 450a53b918..b61db7d6e7 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 @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { - +public struct Model200Response: Codable { public var name: Int? public var _class: String? @@ -19,7 +18,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } 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 6deb69fcd7..8ab4db44b7 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 @@ -8,8 +8,7 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { - +public struct Name: Codable { public var name: Int public var snakeCase: Int? @@ -23,7 +22,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property 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 0c9ee2b7b9..4d1dafcc2c 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 @@ -7,9 +7,7 @@ import Foundation - -public struct NumberOnly: Codable { - +public struct NumberOnly: Codable { public var justNumber: Double? @@ -17,7 +15,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } 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 ab0eac0b30..40c30cc860 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Order: Codable { - +public struct Order: Codable { 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 4a7d227104..18c3a024f1 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 @@ -7,9 +7,7 @@ import Foundation - -public struct OuterComposite: Codable { - +public struct OuterComposite: Codable { public var myNumber: Double? public var myString: String? @@ -21,7 +19,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index 9e6b8d74e8..c3b778cbbe 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,7 +7,6 @@ import Foundation - public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" 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 a973071d6c..b9ce0e9332 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Pet: Codable { - +public struct Pet: Codable { 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 b2a6b7e2b8..0acd21fd10 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 @@ -7,9 +7,7 @@ import Foundation - -public struct ReadOnlyFirst: Codable { - +public struct ReadOnlyFirst: Codable { 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 7e089dcee2..c223f993a6 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 @@ -8,8 +8,7 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { - +public struct Return: Codable { public var _return: Int? @@ -17,7 +16,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } 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 e890ef9525..6e8650f76d 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 @@ -7,9 +7,7 @@ import Foundation - -public struct SpecialModelName: Codable { - +public struct SpecialModelName: Codable { public var specialPropertyName: Int64? @@ -17,7 +15,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } 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 f65ae0623d..3f1237fee4 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 @@ -7,12 +7,9 @@ import Foundation +public struct StringBooleanMap: Codable { -public struct StringBooleanMap: Codable { - - - - public var additionalProperties: [String:Bool] = [:] + public var additionalProperties: [String: Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -45,5 +42,4 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } - } 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 a91b6061bc..4dd8a9a9f5 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 @@ -7,9 +7,7 @@ import Foundation - -public struct Tag: Codable { - +public struct Tag: Codable { 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 2d377c3edb..a9e088808e 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 @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderDefault: Codable { - +public struct TypeHolderDefault: Codable { public var stringItem: String = "what" public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" 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 e5eb92da69..dff4083ae4 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 @@ -7,9 +7,7 @@ import Foundation - -public struct TypeHolderExample: Codable { - +public struct TypeHolderExample: Codable { public var stringItem: String public var numberItem: Double @@ -25,7 +23,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" 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 f70328ca9e..79f271ed73 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 @@ -7,9 +7,7 @@ import Foundation - -public struct User: Codable { - +public struct User: Codable { public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 5700bb62c0..a31860adfd 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + + required public 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 URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId:String = UUID().uuidString + let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default 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: httpResponse.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(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with:"") + .replacingCharacters(in: range, with: "") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url : URL) throws -> String { + fileprivate func getPath(from url: URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBuil } } -fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -fileprivate class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { - +private class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ fileprivate class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -fileprivate class FileUploadEncoding: ParameterEncoding { +private class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,9 +486,9 @@ fileprivate class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)--") urlRequest.httpBody = body @@ -501,13 +501,13 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") @@ -516,25 +516,25 @@ fileprivate class FileUploadEncoding: ParameterEncoding { body.append(fileData) body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty - + body.append("--\(boundary)\r\n") body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") body.append(data) - + body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/default/README.md b/samples/client/petstore/swift5/default/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/default/README.md +++ b/samples/client/petstore/swift5/default/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } internal func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index f14bd48ace..280238b826 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ internal class CodableHelper { set { self.customJSONEncoder = newValue } } - internal class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + internal class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - internal class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + internal class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index b8cfe114dc..ae2e1d0b86 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } internal class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/nonPublicApi/README.md b/samples/client/petstore/swift5/nonPublicApi/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/nonPublicApi/README.md +++ b/samples/client/petstore/swift5/nonPublicApi/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/objcCompatible/README.md b/samples/client/petstore/swift5/objcCompatible/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/objcCompatible/README.md +++ b/samples/client/petstore/swift5/objcCompatible/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj index 7664d648f4..31525ebfdc 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,14 +305,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -568,7 +567,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/promisekitLibrary/README.md b/samples/client/petstore/swift5/promisekitLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/README.md +++ b/samples/client/petstore/swift5/promisekitLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 869f1ccd25..001f716081 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -15,7 +15,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 2764fb314a..1289d6e2a9 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -14,7 +14,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +49,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +84,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +119,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +154,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +190,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +229,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +279,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testEndpointParametersWithRequestBuilder(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(apiResponseQueue) { result -> Void in switch result { case .success: @@ -424,7 +424,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -490,7 +490,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -543,7 +543,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -580,7 +580,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 5f21b82aa3..f54d6e7fcf 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -15,7 +15,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index a9c5c89eb1..c181556113 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -15,7 +15,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +55,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -111,7 +111,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[Pet], Error>) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], Error>) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +154,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[Pet], Error>) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], Error>) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -197,7 +197,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -240,7 +240,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +281,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -333,7 +333,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -385,7 +385,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f67d192fa9..5024c9dc8f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -15,7 +15,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -54,7 +54,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result<[String: Int], Error>) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], Error>) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -93,7 +93,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -133,7 +133,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 930d55d942..c96c572b50 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -15,7 +15,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +52,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +88,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +124,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -164,7 +164,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -204,7 +204,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -245,7 +245,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +281,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the result */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Result) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/resultLibrary/README.md b/samples/client/petstore/swift5/resultLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/resultLibrary/README.md +++ b/samples/client/petstore/swift5/resultLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj index a039b69cf5..8efc1d35ec 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -305,14 +305,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -568,7 +567,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/README.md b/samples/client/petstore/swift5/rxswiftLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/README.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj index 0e4ec79d98..6f8918eb33 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.pbxproj @@ -265,14 +265,13 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 1020; - TargetAttributes = { - }; }; buildConfigurationList = ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( + Base, en, ); mainGroup = 5FBA6AE5F64CD737F88B4565; @@ -520,7 +519,7 @@ 3B2C02AFB91CB5C82766ED5C /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Debug; + defaultConfigurationName = ""; }; ECAB17FF35111B5E14DAAC08 /* Build configuration list for PBXProject "PetstoreClient" */ = { isa = XCConfigurationList; diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 59618cad9c..919434a625 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme index ce431fd1d1..26d510552b 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -41,6 +41,10 @@ + + + + + + { } } - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { } + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { } public func addHeader(name: String, value: String) -> Self { if !value.isEmpty { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index 32e194f6ee..ef971ebadc 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -38,11 +38,11 @@ open class CodableHelper { set { self.customJSONEncoder = newValue } } - open class func decode(_ type: T.Type, from data: Data) -> Result where T: Decodable { - return Result { try self.jsonDecoder.decode(type, from: data) } + open class func decode(_ type: T.Type, from data: Data) -> Swift.Result where T: Decodable { + return Swift.Result { try self.jsonDecoder.decode(type, from: data) } } - open class func encode(_ value: T) -> Result where T: Encodable { - return Result { try self.jsonEncoder.encode(value) } + open class func encode(_ value: T) -> Swift.Result where T: Encodable { + return Swift.Result { try self.jsonEncoder.encode(value) } } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index ad5f58eea4..a31860adfd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -102,7 +102,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return modifiedRequest } - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Result, Error>) -> Void) { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { let urlSessionId: String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() @@ -180,7 +180,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) @@ -312,7 +312,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { - override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Result, Error>) -> Void) { + override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { completion(.failure(ErrorResponse.error(-1, data, error))) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/README.md b/samples/client/petstore/swift5/urlsessionLibrary/README.md index 4829f29f6a..1725415f7e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/README.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/README.md @@ -3,7 +3,7 @@ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ ## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. +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: 1.0.0 - Package version: From 3db7f65e3e2cb81f08c97f5d5beb2c0e8e10fc69 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Apr 2020 10:56:12 +0800 Subject: [PATCH 08/25] Add a link to the blog post in Nordic APIs (#6038) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ec9b3822b9..1fa10dd45e 100644 --- a/README.md +++ b/README.md @@ -749,6 +749,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - 2020-03-10 - [OpenAPI Generator Meetup #1](https://speakerdeck.com/akihito_nakano/openapi-generator-meetup-number-1) by [中野暁人](https://github.com/ackintosh) at [OpenAPI Generator Meetup #1](https://openapi-generator-meetup.connpass.com/event/168187/) - 2020-03-15 - [Load Testing Your API with Swagger/OpenAPI and k6](https://k6.io/blog/load-testing-your-api-with-swagger-openapi-and-k6) - 2020-04-13 - [俺的【OAS】との向き合い方 (爆速でOpenAPIと友達になろう)](https://tech-blog.optim.co.jp/entry/2020/04/13/100000) in [OPTim Blog](https://tech-blog.optim.co.jp/) +- 2020-04-22 - [Introduction to OpenAPI Generator](https://nordicapis.com/introduction-to-openapi-generator/) by [Kristopher Sandoval](https://nordicapis.com/author/sandovaleffect/) in [Nordic APIs](https://nordicapis.com/) ## [6 - About Us](#table-of-contents) From 93dd4a5138178526f8fbf94b670b4d2d0d3835a6 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Apr 2020 12:47:25 +0800 Subject: [PATCH 09/25] Add jersey2-experimental to Java client generator (#6024) * add jersey2 experimental * add new files * add abstract one of class * read the stream multiple times * rename to getActualInstance * update petstore * fix jackon check * test new java petstore in ci * fix broken tests * remove todo * better exception message, primitive type handling * add anyof support * update samples * add new files * update all java client samples * update doc, fix pom * better null check for allOf * add primitive types support in oneof, anyof * better validation * update python exp samples * remove primitive type support in allOf --- bin/java-petstore-jersey2-experimental.json | 4 + bin/java-petstore-jersey2-experimental.sh | 48 + docs/generators/java.md | 2 +- .../openapitools/codegen/DefaultCodegen.java | 38 +- .../codegen/languages/JavaClientCodegen.java | 52 +- .../src/main/resources/Java/api_test.mustache | 22 +- .../AbstractOpenApiSchema.mustache | 30 + .../jersey2-experimental/ApiClient.mustache | 1072 ++++++++ .../jersey2-experimental/ApiResponse.mustache | 58 + .../jersey2-experimental/JSON.mustache | 65 + .../jersey2-experimental/anyof_model.mustache | 28 + .../jersey2-experimental/api.mustache | 244 ++ .../apiException.mustache | 96 + .../jersey2-experimental/api_doc.mustache | 121 + .../jersey2-experimental/api_test.mustache | 51 + .../build.gradle.mustache | 170 ++ .../jersey2-experimental/build.sbt.mustache | 38 + .../jersey2-experimental/model.mustache | 47 + .../jersey2-experimental/oneof_model.mustache | 45 + .../jersey2-experimental/pojo.mustache | 369 +++ .../jersey2-experimental/pom.mustache | 372 +++ .../Java/libraries/jersey2/pom.mustache | 2 +- .../codegen/DefaultCodegenTest.java | 6 +- pom.xml | 2 + .../java/jersey2-experimental/.gitignore | 21 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/VERSION | 1 + .../java/jersey2-experimental/.travis.yml | 22 + .../java/jersey2-experimental/README.md | 238 ++ .../jersey2-experimental/api/openapi.yaml | 2183 +++++++++++++++++ .../java/jersey2-experimental/build.gradle | 123 + .../java/jersey2-experimental/build.sbt | 24 + .../docs/AdditionalPropertiesAnyType.md | 12 + .../docs/AdditionalPropertiesArray.md | 12 + .../docs/AdditionalPropertiesBoolean.md | 12 + .../docs/AdditionalPropertiesClass.md | 22 + .../docs/AdditionalPropertiesInteger.md | 12 + .../docs/AdditionalPropertiesNumber.md | 12 + .../docs/AdditionalPropertiesObject.md | 12 + .../docs/AdditionalPropertiesString.md | 12 + .../java/jersey2-experimental/docs/Animal.md | 13 + .../docs/AnotherFakeApi.md | 74 + .../docs/ArrayOfArrayOfNumberOnly.md | 12 + .../docs/ArrayOfNumberOnly.md | 12 + .../jersey2-experimental/docs/ArrayTest.md | 14 + .../java/jersey2-experimental/docs/BigCat.md | 23 + .../jersey2-experimental/docs/BigCatAllOf.md | 23 + .../docs/Capitalization.md | 17 + .../java/jersey2-experimental/docs/Cat.md | 12 + .../jersey2-experimental/docs/CatAllOf.md | 12 + .../jersey2-experimental/docs/Category.md | 13 + .../jersey2-experimental/docs/ClassModel.md | 13 + .../java/jersey2-experimental/docs/Client.md | 12 + .../java/jersey2-experimental/docs/Dog.md | 12 + .../jersey2-experimental/docs/DogAllOf.md | 12 + .../jersey2-experimental/docs/EnumArrays.md | 31 + .../jersey2-experimental/docs/EnumClass.md | 15 + .../jersey2-experimental/docs/EnumTest.md | 54 + .../java/jersey2-experimental/docs/FakeApi.md | 997 ++++++++ .../docs/FakeClassnameTags123Api.md | 81 + .../docs/FileSchemaTestClass.md | 13 + .../jersey2-experimental/docs/FormatTest.md | 25 + .../docs/HasOnlyReadOnly.md | 13 + .../java/jersey2-experimental/docs/MapTest.md | 24 + ...dPropertiesAndAdditionalPropertiesClass.md | 14 + .../docs/Model200Response.md | 14 + .../docs/ModelApiResponse.md | 14 + .../jersey2-experimental/docs/ModelReturn.md | 13 + .../java/jersey2-experimental/docs/Name.md | 16 + .../jersey2-experimental/docs/NumberOnly.md | 12 + .../java/jersey2-experimental/docs/Order.md | 27 + .../docs/OuterComposite.md | 14 + .../jersey2-experimental/docs/OuterEnum.md | 15 + .../java/jersey2-experimental/docs/Pet.md | 27 + .../java/jersey2-experimental/docs/PetApi.md | 656 +++++ .../docs/ReadOnlyFirst.md | 13 + .../docs/SpecialModelName.md | 12 + .../jersey2-experimental/docs/StoreApi.md | 276 +++ .../java/jersey2-experimental/docs/Tag.md | 13 + .../docs/TypeHolderDefault.md | 16 + .../docs/TypeHolderExample.md | 17 + .../java/jersey2-experimental/docs/User.md | 19 + .../java/jersey2-experimental/docs/UserApi.md | 525 ++++ .../java/jersey2-experimental/docs/XmlItem.md | 40 + .../java/jersey2-experimental/git_push.sh | 58 + .../jersey2-experimental/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 58702 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../java/jersey2-experimental/gradlew | 183 ++ .../java/jersey2-experimental/gradlew.bat | 100 + .../java/jersey2-experimental/pom.xml | 293 +++ .../java/jersey2-experimental/settings.gradle | 1 + .../src/main/AndroidManifest.xml | 3 + .../org/openapitools/client/ApiClient.java | 995 ++++++++ .../org/openapitools/client/ApiException.java | 91 + .../org/openapitools/client/ApiResponse.java | 59 + .../openapitools/client/Configuration.java | 39 + .../client/CustomInstantDeserializer.java | 232 ++ .../java/org/openapitools/client/JSON.java | 47 + .../java/org/openapitools/client/Pair.java | 61 + .../client/RFC3339DateFormat.java | 32 + .../client/ServerConfiguration.java | 58 + .../openapitools/client/ServerVariable.java | 23 + .../org/openapitools/client/StringUtil.java | 61 + .../client/api/AnotherFakeApi.java | 104 + .../org/openapitools/client/api/FakeApi.java | 1198 +++++++++ .../client/api/FakeClassnameTags123Api.java | 104 + .../org/openapitools/client/api/PetApi.java | 692 ++++++ .../org/openapitools/client/api/StoreApi.java | 305 +++ .../org/openapitools/client/api/UserApi.java | 577 +++++ .../openapitools/client/auth/ApiKeyAuth.java | 77 + .../client/auth/Authentication.java | 30 + .../client/auth/HttpBasicAuth.java | 58 + .../client/auth/HttpBearerAuth.java | 60 + .../org/openapitools/client/auth/OAuth.java | 39 + .../openapitools/client/auth/OAuthFlow.java | 18 + .../client/model/AbstractOpenApiSchema.java | 41 + .../model/AdditionalPropertiesAnyType.java | 106 + .../model/AdditionalPropertiesArray.java | 107 + .../model/AdditionalPropertiesBoolean.java | 106 + .../model/AdditionalPropertiesClass.java | 480 ++++ .../model/AdditionalPropertiesInteger.java | 106 + .../model/AdditionalPropertiesNumber.java | 107 + .../model/AdditionalPropertiesObject.java | 106 + .../model/AdditionalPropertiesString.java | 106 + .../org/openapitools/client/model/Animal.java | 141 ++ .../model/ArrayOfArrayOfNumberOnly.java | 113 + .../client/model/ArrayOfNumberOnly.java | 113 + .../openapitools/client/model/ArrayTest.java | 191 ++ .../org/openapitools/client/model/BigCat.java | 145 ++ .../client/model/BigCatAllOf.java | 141 ++ .../client/model/Capitalization.java | 257 ++ .../org/openapitools/client/model/Cat.java | 106 + .../openapitools/client/model/CatAllOf.java | 102 + .../openapitools/client/model/Category.java | 132 + .../openapitools/client/model/ClassModel.java | 103 + .../org/openapitools/client/model/Client.java | 102 + .../org/openapitools/client/model/Dog.java | 106 + .../openapitools/client/model/DogAllOf.java | 102 + .../openapitools/client/model/EnumArrays.java | 213 ++ .../openapitools/client/model/EnumClass.java | 60 + .../openapitools/client/model/EnumTest.java | 370 +++ .../client/model/FileSchemaTestClass.java | 143 ++ .../openapitools/client/model/FormatTest.java | 516 ++++ .../client/model/HasOnlyReadOnly.java | 115 + .../openapitools/client/model/MapTest.java | 265 ++ ...ropertiesAndAdditionalPropertiesClass.java | 178 ++ .../client/model/Model200Response.java | 134 + .../client/model/ModelApiResponse.java | 164 ++ .../client/model/ModelReturn.java | 103 + .../org/openapitools/client/model/Name.java | 177 ++ .../openapitools/client/model/NumberOnly.java | 103 + .../org/openapitools/client/model/Order.java | 295 +++ .../client/model/OuterComposite.java | 165 ++ .../openapitools/client/model/OuterEnum.java | 60 + .../org/openapitools/client/model/Pet.java | 309 +++ .../client/model/ReadOnlyFirst.java | 124 + .../client/model/SpecialModelName.java | 102 + .../org/openapitools/client/model/Tag.java | 133 + .../client/model/TypeHolderDefault.java | 229 ++ .../client/model/TypeHolderExample.java | 259 ++ .../org/openapitools/client/model/User.java | 319 +++ .../openapitools/client/model/XmlItem.java | 1045 ++++++++ .../client/api/AnotherFakeApiTest.java | 50 + .../openapitools/client/api/FakeApiTest.java | 291 +++ .../api/FakeClassnameTags123ApiTest.java | 50 + .../openapitools/client/api/PetApiTest.java | 179 ++ .../openapitools/client/api/StoreApiTest.java | 94 + .../openapitools/client/api/UserApiTest.java | 156 ++ .../AdditionalPropertiesAnyTypeTest.java | 51 + .../model/AdditionalPropertiesArrayTest.java | 52 + .../AdditionalPropertiesBooleanTest.java | 51 + .../model/AdditionalPropertiesClassTest.java | 133 + .../AdditionalPropertiesIntegerTest.java | 51 + .../model/AdditionalPropertiesNumberTest.java | 52 + .../model/AdditionalPropertiesObjectTest.java | 51 + .../model/AdditionalPropertiesStringTest.java | 51 + .../openapitools/client/model/AnimalTest.java | 59 + .../model/ArrayOfArrayOfNumberOnlyTest.java | 52 + .../client/model/ArrayOfNumberOnlyTest.java | 52 + .../client/model/ArrayTestTest.java | 68 + .../client/model/BigCatAllOfTest.java | 49 + .../openapitools/client/model/BigCatTest.java | 75 + .../client/model/CapitalizationTest.java | 89 + .../client/model/CatAllOfTest.java | 49 + .../openapitools/client/model/CatTest.java | 67 + .../client/model/CategoryTest.java | 57 + .../client/model/ClassModelTest.java | 49 + .../openapitools/client/model/ClientTest.java | 49 + .../client/model/DogAllOfTest.java | 49 + .../openapitools/client/model/DogTest.java | 67 + .../client/model/EnumArraysTest.java | 59 + .../client/model/EnumClassTest.java | 33 + .../client/model/EnumTestTest.java | 82 + .../client/model/FileSchemaTestClassTest.java | 59 + .../client/model/FormatTestTest.java | 158 ++ .../client/model/HasOnlyReadOnlyTest.java | 57 + .../client/model/MapTestTest.java | 76 + ...rtiesAndAdditionalPropertiesClassTest.java | 71 + .../client/model/Model200ResponseTest.java | 57 + .../client/model/ModelApiResponseTest.java | 65 + .../client/model/ModelReturnTest.java | 49 + .../openapitools/client/model/NameTest.java | 73 + .../client/model/NumberOnlyTest.java | 50 + .../openapitools/client/model/OrderTest.java | 90 + .../client/model/OuterCompositeTest.java | 66 + .../client/model/OuterEnumTest.java | 33 + .../openapitools/client/model/PetTest.java | 93 + .../client/model/ReadOnlyFirstTest.java | 57 + .../client/model/SpecialModelNameTest.java | 49 + .../openapitools/client/model/TagTest.java | 57 + .../client/model/TypeHolderDefaultTest.java | 84 + .../client/model/TypeHolderExampleTest.java | 92 + .../openapitools/client/model/UserTest.java | 105 + .../client/model/XmlItemTest.java | 276 +++ .../petstore/java/jersey2-java6/pom.xml | 2 +- .../petstore/java/jersey2-java8/pom.xml | 2 +- samples/client/petstore/java/jersey2/pom.xml | 2 +- .../go-petstore/api/openapi.yaml | 6 +- 219 files changed, 27324 insertions(+), 30 deletions(-) create mode 100644 bin/java-petstore-jersey2-experimental.json create mode 100755 bin/java-petstore-jersey2-experimental.sh create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiResponse.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/anyof_model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/apiException.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_test.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.gradle.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.sbt.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/oneof_model.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pojo.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache create mode 100644 samples/client/petstore/java/jersey2-experimental/.gitignore create mode 100644 samples/client/petstore/java/jersey2-experimental/.openapi-generator-ignore create mode 100644 samples/client/petstore/java/jersey2-experimental/.openapi-generator/VERSION create mode 100644 samples/client/petstore/java/jersey2-experimental/.travis.yml create mode 100644 samples/client/petstore/java/jersey2-experimental/README.md create mode 100644 samples/client/petstore/java/jersey2-experimental/api/openapi.yaml create mode 100644 samples/client/petstore/java/jersey2-experimental/build.gradle create mode 100644 samples/client/petstore/java/jersey2-experimental/build.sbt create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesAnyType.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesArray.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesBoolean.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesInteger.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesNumber.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesObject.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesString.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Animal.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ArrayOfArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ArrayOfNumberOnly.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ArrayTest.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/BigCat.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/BigCatAllOf.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Capitalization.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Cat.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/CatAllOf.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Category.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ClassModel.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Client.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Dog.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/DogAllOf.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/EnumArrays.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/EnumClass.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/FileSchemaTestClass.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/HasOnlyReadOnly.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/MapTest.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Model200Response.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ModelApiResponse.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ModelReturn.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Name.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/NumberOnly.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Order.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/OuterComposite.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/OuterEnum.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Pet.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/PetApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/ReadOnlyFirst.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/SpecialModelName.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Tag.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/TypeHolderDefault.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/TypeHolderExample.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/User.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/UserApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/XmlItem.md create mode 100644 samples/client/petstore/java/jersey2-experimental/git_push.sh create mode 100644 samples/client/petstore/java/jersey2-experimental/gradle.properties create mode 100644 samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/java/jersey2-experimental/gradlew create mode 100644 samples/client/petstore/java/jersey2-experimental/gradlew.bat create mode 100644 samples/client/petstore/java/jersey2-experimental/pom.xml create mode 100644 samples/client/petstore/java/jersey2-experimental/settings.gradle create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/AndroidManifest.xml create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java diff --git a/bin/java-petstore-jersey2-experimental.json b/bin/java-petstore-jersey2-experimental.json new file mode 100644 index 0000000000..156775302d --- /dev/null +++ b/bin/java-petstore-jersey2-experimental.json @@ -0,0 +1,4 @@ +{ + "library": "jersey2-experimental", + "artifactId": "petstore-jersey2-exp" +} diff --git a/bin/java-petstore-jersey2-experimental.sh b/bin/java-petstore-jersey2-experimental.sh new file mode 100755 index 0000000000..a4ab8a13a8 --- /dev/null +++ b/bin/java-petstore-jersey2-experimental.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +SCRIPT="$0" +echo "# START SCRIPT: $SCRIPT" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar" + +if [ ! -f "$executable" ] +then + mvn -B clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-experimental.json -o samples/client/petstore/java/jersey2-experimental -t modules/openapi-generator/src/main/resources/Java --additional-properties hideGenerationTimestamp=true $@" + +echo "Removing files and folders under samples/client/petstore/java/jersey2-experimental/src/main" +rm -rf samples/client/petstore/java/jersey2-experimental/src/main +find samples/client/petstore/java/jersey2-experimental -maxdepth 1 -type f ! -name "README.md" -exec rm {} + +java $JAVA_OPTS -jar $executable $ags + +# copy additional manually written unit-tests +#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client +#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth +#mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model + +#cp CI/samples.ci/client/petstore/java/test-manual/common/StringUtilTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/StringUtilTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/ApiClientTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ApiClientTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/common/ConfigurationTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/ConfigurationTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/ApiKeyAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/ApiKeyAuthTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/auth/HttpBasicAuthTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth/HttpBasicAuthTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/model/EnumValueTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/model/EnumValueTest.java +#cp CI/samples.ci/client/petstore/java/test-manual/jersey2/JSONTest.java samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/JSONTest.java diff --git a/docs/generators/java.md b/docs/generators/java.md index 8789be83d7..8cdcd9dc4e 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -29,7 +29,7 @@ sidebar_label: java |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| -|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit**
    HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
    |okhttp-gson| +|library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **jersey2-experimental**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit**
    HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.client.model| 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 f0906626ee..6f5990074c 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 @@ -1846,8 +1846,8 @@ public class DefaultCodegen implements CodegenConfig { @SuppressWarnings("static-method") public String toOneOfName(List names, ComposedSchema composedSchema) { Map exts = composedSchema.getExtensions(); - if (exts != null && exts.containsKey("x-oneOf-name")) { - return (String) exts.get("x-oneOf-name"); + if (exts != null && exts.containsKey("x-one-of-name")) { + return (String) exts.get("x-one-of-name"); } return "oneOf<" + String.join(",", names) + ">"; } @@ -2190,9 +2190,33 @@ public class DefaultCodegen implements CodegenConfig { m.interfaces = new ArrayList(); for (Schema interfaceSchema : interfaces) { + interfaceSchema = ModelUtils.unaliasSchema(this.openAPI, interfaceSchema, importMapping); + if (StringUtils.isBlank(interfaceSchema.get$ref())) { + // primitive type + String languageType = getTypeDeclaration(interfaceSchema); + + if (composed.getAnyOf() != null) { + if (m.anyOf.contains(languageType)) { + LOGGER.warn("{} (anyOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType); + } else { + m.anyOf.add(languageType); + } + } else if (composed.getOneOf() != null) { + if (m.oneOf.contains(languageType)) { + LOGGER.warn("{} (oneOf schema) already has `{}` defined and therefore it's skipped.", m.name, languageType); + } else { + m.oneOf.add(languageType); + } + } else if (composed.getAllOf() != null) { + // no need to add primitive type to allOf, which should comprise of schemas (models) only + } else { + LOGGER.error("Composed schema has incorrect anyOf, allOf, oneOf defined: {}", composed); + } continue; } + + // the rest of the section is for model Schema refSchema = null; String ref = ModelUtils.getSimpleRef(interfaceSchema.get$ref()); if (allDefinitions != null) { @@ -2393,8 +2417,10 @@ public class DefaultCodegen implements CodegenConfig { if (schema instanceof ComposedSchema) { ComposedSchema composedSchema = (ComposedSchema) schema; - for (Schema component : composedSchema.getAllOf()) { - addProperties(properties, required, component); + if (composedSchema.getAllOf() != null) { + for (Schema component : composedSchema.getAllOf()) { + addProperties(properties, required, component); + } } if (schema.getRequired() != null) { @@ -5788,14 +5814,14 @@ public class DefaultCodegen implements CodegenConfig { //// Following methods are related to the "useOneOfInterfaces" feature /** - * Add "x-oneOf-name" extension to a given oneOf schema (assuming it has at least 1 oneOf elements) + * Add "x-one-of-name" extension to a given oneOf schema (assuming it has at least 1 oneOf elements) * * @param s schema to add the extension to * @param name name of the parent oneOf schema */ public void addOneOfNameExtension(ComposedSchema s, String name) { if (s.getOneOf() != null && s.getOneOf().size() > 0) { - s.addExtension("x-oneOf-name", name); + s.addExtension("x-one-of-name", name); } } 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 58134a28b1..5caf5c0b67 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 @@ -71,6 +71,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String GOOGLE_API_CLIENT = "google-api-client"; public static final String JERSEY1 = "jersey1"; public static final String JERSEY2 = "jersey2"; + public static final String JERSEY2_EXPERIMENTAL = "jersey2-experimental"; public static final String NATIVE = "native"; public static final String OKHTTP_GSON = "okhttp-gson"; public static final String RESTEASY = "resteasy"; @@ -144,6 +145,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead."); supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); + supportedLibraries.put(JERSEY2_EXPERIMENTAL, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); @@ -367,9 +369,12 @@ public class JavaClientCodegen extends AbstractJavaCodegen if ("retrofit2".equals(getLibrary()) && !usePlayWS) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); } - } else if (JERSEY2.equals(getLibrary())) { + } else if (JERSEY2.equals(getLibrary()) || JERSEY2_EXPERIMENTAL.equals(getLibrary())) { supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); + if (JERSEY2_EXPERIMENTAL.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar), "AbstractOpenApiSchema.java")); + } forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); } else if (NATIVE.equals(getLibrary())) { setJava8Mode(true); @@ -499,7 +504,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen additionalProperties.remove(SERIALIZATION_LIBRARY_GSON); } - if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON)) { + if (additionalProperties.containsKey(SERIALIZATION_LIBRARY_JACKSON) && !JERSEY2_EXPERIMENTAL.equals(getLibrary())) { useOneOfInterfaces = true; addOneOfInterfaceImports = true; } @@ -595,6 +600,39 @@ public class JavaClientCodegen extends AbstractJavaCodegen objs = AbstractJavaJAXRSServerCodegen.jaxrsPostProcessOperations(objs); } + if (JERSEY2_EXPERIMENTAL.equals(getLibrary())) { + // index the model + HashMap modelMaps = new HashMap(); + for (Object o : allModels) { + HashMap h = (HashMap) o; + CodegenModel m = (CodegenModel) h.get("model"); + modelMaps.put(m.classname, m); + + } + + // check if return type is oneOf/anyeOf model + Map operations = (Map) objs.get("operations"); + List operationList = (List) operations.get("operation"); + for (CodegenOperation op : operationList) { + if (op.returnType != null) { + // look up the model to see if it's anyOf/oneOf + if (modelMaps.containsKey(op.returnType) && modelMaps.get(op.returnType) != null) { + CodegenModel cm = modelMaps.get(op.returnType); + + if (cm.oneOf != null && !cm.oneOf.isEmpty()) { + op.vendorExtensions.put("x-java-return-type-one-of", true); + } + + if (cm.anyOf != null && !cm.anyOf.isEmpty()) { + op.vendorExtensions.put("x-java-return-type-any-of", true); + } + } else { + //LOGGER.error("cannot lookup model " + op.returnType); + } + } + } + } + return objs; } @@ -769,12 +807,16 @@ public class JavaClientCodegen extends AbstractJavaCodegen CodegenModel cm = (CodegenModel) mo.get("model"); cm.getVendorExtensions().putIfAbsent("implements", new ArrayList()); // TODO: 5.0 Remove cm.getVendorExtensions().putIfAbsent("x-implements", cm.getVendorExtensions().get("implements")); - List impl = (List) cm.getVendorExtensions().get("implements"); + //List impl = (List) cm.getVendorExtensions().get("x-implements"); + if (JERSEY2_EXPERIMENTAL.equals(getLibrary())) { + cm.getVendorExtensions().put("x-implements", new ArrayList()); + } + if (this.parcelableModel) { - impl.add("Parcelable"); + ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Parcelable"); } if (this.serializableModel) { - impl.add("Serializable"); + ((ArrayList) cm.getVendorExtensions().get("x-implements")).add("Serializable"); } } diff --git a/modules/openapi-generator/src/main/resources/Java/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/api_test.mustache index 1d95ac2ed8..7011191c80 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_test.mustache @@ -7,39 +7,45 @@ import {{invokerPackage}}.ApiException; {{/imports}} import org.junit.Test; import org.junit.Ignore; +import org.junit.Assert; {{^fullJavaUtil}} import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -{{/fullJavaUtil}} +{{/fullJavaUtil}} /** * API tests for {{classname}} */ -@Ignore public class {{classname}}Test { private final {{classname}} api = new {{classname}}(); - {{#operations}}{{#operation}} + {{#operations}} + {{#operation}} /** + {{#summary}} * {{summary}} * + {{/summary}} + {{#notes}} * {{notes}} * + {{/notes}} * @throws ApiException * if the Api call fails */ @Test public void {{operationId}}Test() throws ApiException { - {{#allParams}} - {{{dataType}}} {{paramName}} = null; - {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + //{{#allParams}} + //{{{dataType}}} {{paramName}} = null; + //{{/allParams}} + //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); // TODO: test validations } - {{/operation}}{{/operations}} + {{/operation}} + {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache new file mode 100644 index 0000000000..607c223aa2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/AbstractOpenApiSchema.mustache @@ -0,0 +1,30 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.model; + +import org.openapitools.client.ApiException; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} +public abstract class AbstractOpenApiSchema { + + private Object instance; + + public final String schemaType; + + public AbstractOpenApiSchema(String schemaType) { + this.schemaType = schemaType; + } + + public abstract Map getSchemas(); + + public Object getActualInstance() {return instance;} + + public void setActualInstance(Object instance) {this.instance = instance;} + + public String getSchemaType() { + return schemaType; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache new file mode 100644 index 0000000000..618264dc90 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache @@ -0,0 +1,1072 @@ +package {{invokerPackage}}; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +{{^supportJava6}} +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +{{/supportJava6}} +{{#supportJava6}} +import org.apache.commons.io.FileUtils; +import org.glassfish.jersey.filter.LoggingFilter; +{{/supportJava6}} +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.TimeZone; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.ApiKeyAuth; +import {{invokerPackage}}.model.AbstractOpenApiSchema; + +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +{{>generatedAnnotation}} +public class ApiClient { + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String basePath = "{{{basePath}}}"; + protected List servers = new ArrayList({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + new HashMap(){{#variables}}{{#-first}} {{ +{{/-first}} put("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new HashSet( + {{#enumValues}} + {{#-first}} + Arrays.asList( + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ) + {{/-last}} + {{/enumValues}} + ) + )); + {{#-last}} + }}{{/-last}}{{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected Map> operationServers = new HashMap>() {{ + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers}} + {{#-first}} + put("{{{classname}}}.{{{operationId}}}", new ArrayList(Arrays.asList( + {{/-first}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + new HashMap(){{#variables}}{{#-first}} {{ +{{/-first}} put("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new HashSet( + {{#enumValues}} + {{#-first}} + Arrays.asList( + {{/-first}} + "{{{.}}}"{{^-last}},{{/-last}} + {{#-last}} + ) + {{/-last}} + {{/enumValues}} + ) + )); + {{#-last}} + }}{{/-last}}{{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + )));{{/-last}} + {{/servers}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + }}; + protected Map operationServerIndex = new HashMap(); + protected Map> operationServerVariables = new HashMap>(); + protected boolean debugging = false; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + public ApiClient() { + json = new JSON(); + httpClient = buildHttpClient(debugging); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} + authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * @return JSON + */ + public JSON getJSON() { + return json; + } + + public Client getHttpClient() { + return httpClient; + } + + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + public String getBasePath() { + return basePath; + } + + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + */ + public void configureApiKeys(HashMap secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + if (secrets.containsKey(name)) { + ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + } + } + } + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent Http user agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(debugging); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param readTimeout Read timeout in milliseconds + * @return API client + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()).size(file.length()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + } + return entity; + } + + public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{ + + Object result = null; + int matchCounter = 0; + ArrayList matchSchemas = new ArrayList<>(); + + for (Map.Entry entry : schema.getSchemas().entrySet()) { + String schemaName = entry.getKey(); + GenericType schemaType = entry.getValue(); + + if (schemaType instanceof GenericType) { // model + try { + Object deserializedObject = deserialize(response, schemaType); + if (deserializedObject != null) { + result = deserializedObject; + matchCounter++; + + if ("anyOf".equals(schema.getSchemaType())) { + break; + } else if ("oneOf".equals(schema.getSchemaType())) { + matchSchemas.add(schemaName); + } else { + throw new ApiException("Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType()); + } + } else { + // failed to deserialize the response in the schema provided, proceed to the next one if any + } + } catch (Exception ex) { + // failed to deserialize, do nothing and try next one (schema) + } + } else {// unknown type + throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); + } + + } + + if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf + throw new ApiException("Response body is invalid as it matches more than one schema (" + String.join(", ", matchSchemas) + ") defined in the oneOf model: " + schema.getClass().getName()); + } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas + throw new ApiException("Response body is invalid as it doens't match any schemas (" + String.join(", ", schema.getSchemas().keySet()) + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + } else { // only one matched + schema.setActualInstance(result); + return schema; + } + + } + + + + /** + * Deserialize response body to Java object according to the Content-Type. + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + String contentType = null; + List contentTypes = response.getHeaders().get("Content-Type"); + if (contentTypes != null && !contentTypes.isEmpty()) + contentType = String.valueOf(contentTypes.get(0)); + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); +{{^supportJava6}} + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); +{{/supportJava6}} +{{#supportJava6}} + // Java6 falls back to commons.io for file copying + FileUtils.copyToFile(response.readEntity(InputStream.class), file); +{{/supportJava6}} + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param schema An instance of the response that uses oneOf/anyOf + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI(String operation, String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + String targetURL; + if (serverIndex != null) { + Integer index; + List serverConfigurations; + Map variables; + + if (operationServers.containsKey(operation)) { + index = operationServerIndex.getOrDefault(operation, serverIndex); + variables = operationServerVariables.getOrDefault(operation, serverVariables); + serverConfigurations = operationServers.get(operation); + } else { + index = serverIndex; + variables = serverVariables; + serverConfigurations = servers; + } + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size() + )); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request().accept(accept); + + for (Entry entry : headerParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultHeaderMap.entrySet()) { + String key = entry.getKey(); + if (!headerParams.containsKey(key)) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(key, value); + } + } + } + + Entity entity = serialize(body, formParams, contentType); + + Response response = null; + + try { + if ("GET".equals(method)) { + response = invocationBuilder.get(); + } else if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + response = invocationBuilder.method("DELETE", entity); + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else if ("HEAD".equals(method)) { + response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); + } else { + throw new ApiException(500, "unknown method type " + method); + } + + int statusCode = response.getStatusInfo().getStatusCode(); + Map> responseHeaders = buildResponseHeaders(response); + + if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { + return new ApiResponse<{{#supportJava6}}T{{/supportJava6}}>(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) + return new ApiResponse<{{#supportJava6}}T{{/supportJava6}}>(statusCode, responseHeaders); + else + if (schema == null) { + return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType)); + } else { // oneOf/anyOf + return new ApiResponse<>(statusCode, responseHeaders, (T)deserializeSchemas(response, schema)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, just continue + } + } + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, schema); + } + + /** + * Build the Client used to make HTTP requests. + * @param debugging Debug setting + * @return Client + */ + protected Client buildHttpClient(boolean debugging) { + final ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { +{{^supportJava6}} + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); +{{/supportJava6}} +{{#supportJava6}} + clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); +{{/supportJava6}} + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + performAdditionalClientConfiguration(clientConfig); + return ClientBuilder.newClient(clientConfig); + } + + protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { + // No-op extension point + } + + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiResponse.mustache new file mode 100644 index 0000000000..a67b11f054 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiResponse.mustache @@ -0,0 +1,58 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.List; +import java.util.Map; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + {{#caseInsensitiveResponseHeaders}} + Map> responseHeaders = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : headers.entrySet()){ + responseHeaders.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.headers = {{#caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache new file mode 100644 index 0000000000..b442f0836d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache @@ -0,0 +1,65 @@ +package {{invokerPackage}}; + +{{#threetenbp}} +import org.threeten.bp.*; +{{/threetenbp}} +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; +{{#java8}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{/java8}} +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} +{{#threetenbp}} +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +{{/threetenbp}} + +import java.text.DateFormat; + +import javax.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + {{#java8}} + mapper.registerModule(new JavaTimeModule()); + {{/java8}} + {{#joda}} + mapper.registerModule(new JodaModule()); + {{/joda}} + {{#threetenbp}} + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + mapper.registerModule(module); + {{/threetenbp}} + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/anyof_model.mustache new file mode 100644 index 0000000000..a3702d221a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/anyof_model.mustache @@ -0,0 +1,28 @@ +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + + // store a list of schema names defined in anyOf + public final static Map schemas = new HashMap(); + + public {{classname}}() { + super("anyOf"); + } + + static { + {{#anyOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/anyOf}} + } + + @Override + public Map getSchemas() { + return {{classname}}.schemas; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api.mustache new file mode 100644 index 0000000000..a0730135f7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api.mustache @@ -0,0 +1,244 @@ +package {{package}}; + +import {{invokerPackage}}.ApiException; +import {{invokerPackage}}.ApiClient; +import {{invokerPackage}}.ApiResponse; +import {{invokerPackage}}.Configuration; +import {{invokerPackage}}.Pair; + +import javax.ws.rs.core.GenericType; + +{{#imports}}import {{import}}; +{{/imports}} + +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +{{>generatedAnnotation}} +{{#operations}} +public class {{classname}} { + private ApiClient apiClient; + + public {{classname}}() { + this(Configuration.getDefaultApiClient()); + } + + public {{classname}}(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + {{#operation}} + {{^vendorExtensions.x-group-parameters}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + {{#returnType}} + * @return {{returnType}} + {{/returnType}} + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}}.getData(){{/returnType}}; + } + {{/vendorExtensions.x-group-parameters}} + + {{^vendorExtensions.x-group-parameters}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} + {{/allParams}} + * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}} + * @deprecated + {{/isDeprecated}} + {{#externalDocs}} + * {{description}} + * @see {{summary}} Documentation + {{/externalDocs}} + */ + {{#isDeprecated}} + @Deprecated + {{/isDeprecated}} + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) throws ApiException { + Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; + {{#allParams}}{{#required}} + // verify the required parameter '{{paramName}}' is set + if ({{paramName}} == null) { + throw new ApiException(400, "Missing the required parameter '{{paramName}}' when calling {{operationId}}"); + } + {{/required}}{{/allParams}} + // create path and map variables + String localVarPath = "{{{path}}}"{{#pathParams}} + .replaceAll("\\{" + "{{baseName}}" + "\\}", apiClient.escapeString({{{paramName}}}.toString())){{/pathParams}}; + + // query params + {{javaUtilPrefix}}List localVarQueryParams = new {{javaUtilPrefix}}ArrayList(); + {{javaUtilPrefix}}Map localVarHeaderParams = new {{javaUtilPrefix}}HashMap(); + {{javaUtilPrefix}}Map localVarCookieParams = new {{javaUtilPrefix}}HashMap(); + {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); + + {{#queryParams}} + localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + {{/queryParams}} + + {{#headerParams}}if ({{paramName}} != null) + localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/headerParams}} + + {{#cookieParams}}if ({{paramName}} != null) + localVarCookieParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); + {{/cookieParams}} + + {{#formParams}}if ({{paramName}} != null) + localVarFormParams.put("{{baseName}}", {{paramName}}); + {{/formParams}} + + final String[] localVarAccepts = { + {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; + + {{#returnType}} + GenericType<{{{returnType}}}> localVarReturnType = new GenericType<{{{returnType}}}>() {}; + + {{/returnType}} + return apiClient.invokeAPI("{{classname}}.{{operationId}}", localVarPath, "{{httpMethod}}", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#vendorExtensions.x-java-return-type-one-of}}new {{{returnType}}}(){{/vendorExtensions.x-java-return-type-one-of}}{{^vendorExtensions.x-java-return-type-one-of}}{{#vendorExtensions.x-java-return-type-any-of}}new {{{returnType}}}(){{/vendorExtensions.x-java-return-type-any-of}}{{^vendorExtensions.x-java-return-type-any-of}}null{{/vendorExtensions.x-java-return-type-any-of}}{{/vendorExtensions.x-java-return-type-one-of}}); + } + {{#vendorExtensions.x-group-parameters}} + + public class API{{operationId}}Request { + {{#allParams}} + private {{#isRequired}}final {{/isRequired}}{{{dataType}}} {{localVariablePrefix}}{{paramName}}; + {{/allParams}} + + private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) { + {{#pathParams}} + this.{{localVariablePrefix}}{{paramName}} = {{paramName}}; + {{/pathParams}} + } + {{#allParams}}{{^isPathParam}} + + /** + * Set {{paramName}} + * @param {{paramName}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) + * @return API{{operationId}}Request + */ + public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { + this.{{localVariablePrefix}}{{paramName}} = {{paramName}}; + return this; + } + {{/isPathParam}}{{/allParams}} + + /** + * Execute {{operationId}} request + {{#returnType}}* @return {{.}}{{/returnType}} + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}}* @deprecated{{/isDeprecated}} + */ + {{#isDeprecated}}@Deprecated{{/isDeprecated}} + public {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData(); + } + + /** + * Execute {{operationId}} request with HTTP info returned + * @return ApiResponse<{{#returnType}}{{.}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @throws ApiException if fails to make API call + {{#responses.0}} + * @http.response.details + + + {{#responses}} + + {{/responses}} +
    Status Code Description Response Headers
    {{code}} {{message}} {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}}
    + {{/responses.0}} + {{#isDeprecated}}* @deprecated{{/isDeprecated}} + */ + {{#isDeprecated}}@Deprecated{{/isDeprecated}} + public ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + return {{operationId}}WithHttpInfo({{#allParams}}{{localVariablePrefix}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + } + } + + /** + * {{summary}} + * {{notes}}{{#pathParams}} + * @param {{paramName}} {{description}} (required){{/pathParams}} + * @return {{operationId}}Request + * @throws ApiException if fails to make API call + {{#isDeprecated}}* @deprecated{{/isDeprecated}} + {{#externalDocs}}* {{description}} + * @see {{summary}} Documentation{{/externalDocs}} + */ + {{#isDeprecated}}@Deprecated{{/isDeprecated}} + public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}) throws ApiException { + return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}); + } + {{/vendorExtensions.x-group-parameters}} + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/apiException.mustache new file mode 100644 index 0000000000..e895245659 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/apiException.mustache @@ -0,0 +1,96 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Map; +import java.util.List; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +{{>generatedAnnotation}} +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_doc.mustache new file mode 100644 index 0000000000..f162d1cc97 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_doc.mustache @@ -0,0 +1,121 @@ +# {{classname}}{{#description}} + +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +## {{operationId}} + +{{^vendorExtensions.x-group-parameters}} +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) +{{/vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); +{{/vendorExtensions.x-group-parameters}} + +{{summary}}{{#notes}} + +{{{unescapedNotes}}}{{/notes}} + +### Example + +```java +// Import classes: +import {{{invokerPackage}}}.ApiClient; +import {{{invokerPackage}}}.ApiException; +import {{{invokerPackage}}}.Configuration;{{#hasAuthMethods}} +import {{{invokerPackage}}}.auth.*;{{/hasAuthMethods}} +import {{{invokerPackage}}}.models.*; +import {{{package}}}.{{{classname}}}; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("{{{basePath}}}"); + {{#hasAuthMethods}} + {{#authMethods}}{{#isBasic}}{{#isBasicBasic}} + // Configure HTTP basic authorization: {{{name}}} + HttpBasicAuth {{{name}}} = (HttpBasicAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setUsername("YOUR USERNAME"); + {{{name}}}.setPassword("YOUR PASSWORD");{{/isBasicBasic}}{{#isBasicBearer}} + // Configure HTTP bearer authorization: {{{name}}} + HttpBearerAuth {{{name}}} = (HttpBearerAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setBearerToken("BEARER TOKEN");{{/isBasicBearer}}{{/isBasic}}{{#isApiKey}} + // Configure API key authorization: {{{name}}} + ApiKeyAuth {{{name}}} = (ApiKeyAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //{{{name}}}.setApiKeyPrefix("Token");{{/isApiKey}}{{#isOAuth}} + // Configure OAuth2 access token for authorization: {{{name}}} + OAuth {{{name}}} = (OAuth) defaultClient.getAuthentication("{{{name}}}"); + {{{name}}}.setAccessToken("YOUR ACCESS TOKEN");{{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + + {{{classname}}} apiInstance = new {{{classname}}}(defaultClient); + {{#allParams}} + {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} + {{/allParams}} + try { + {{^vendorExtensions.x-group-parameters}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + .execute(); + {{/vendorExtensions.x-group-parameters}} + {{#returnType}} + System.out.println(result); + {{/returnType}} + } catch (ApiException e) { + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (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}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} +- **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{#responses.0}} +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +| **{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
    {{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_test.mustache new file mode 100644 index 0000000000..5ee6e49408 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/api_test.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} + +package {{package}}; + +import {{invokerPackage}}.ApiException; +{{#imports}}import {{import}}; +{{/imports}} +import org.junit.Test; +import org.junit.Ignore; +import org.junit.Assert; + +{{^fullJavaUtil}} +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +{{/fullJavaUtil}} + +/** + * API tests for {{classname}} + */ +public class {{classname}}Test { + + private final {{classname}} api = new {{classname}}(); + + {{#operations}}{{#operation}} + /** + * {{summary}} + * + * {{notes}} + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void {{operationId}}Test() throws ApiException { + {{#allParams}} + //{{{dataType}}} {{paramName}} = null; + {{/allParams}} + {{^vendorExtensions.x-group-parameters}} + //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{/vendorExtensions.x-group-parameters}} + {{#vendorExtensions.x-group-parameters}} + //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + // .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} + // .execute(); + {{/vendorExtensions.x-group-parameters}} + // TODO: test validations + } + {{/operation}}{{/operations}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.gradle.mustache new file mode 100644 index 0000000000..cdb451adb3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.gradle.mustache @@ -0,0 +1,170 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = '{{groupId}}' +version = '{{artifactVersion}}' + +buildscript { + repositories { + maven { url "https://repo1.maven.org/maven2" } + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + jcenter() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + {{#supportJava6}} + sourceCompatibility JavaVersion.VERSION_1_6 + targetCompatibility JavaVersion.VERSION_1_6 + {{/supportJava6}} + {{^supportJava6}} + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} + {{/supportJava6}} + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven' + {{#supportJava6}} + sourceCompatibility = JavaVersion.VERSION_1_6 + targetCompatibility = JavaVersion.VERSION_1_6 + {{/supportJava6}} + {{^supportJava6}} + {{#java8}} + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 + {{/java8}} + {{/supportJava6}} + + install { + repositories.mavenInstaller { + pom.artifactId = '{{artifactId}}' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.5.22" + jackson_version = "2.10.3" + jackson_databind_version = "2.10.3" + jackson_databind_nullable_version = "0.2.1" + {{#supportJava6}} + jersey_version = "2.6" + commons_io_version=2.5 + commons_lang3_version=3.6 + {{/supportJava6}} + {{^supportJava6}} + jersey_version = "2.27" + {{/supportJava6}} + junit_version = "4.13" + {{#threetenbp}} + threetenbp_version = "2.9.10" + {{/threetenbp}} +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.findbugs:jsr305:3.0.2" + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + {{#joda}} + compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" + {{/joda}} + {{#java8}} + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/java8}} + {{#supportJava6}} + compile "commons-io:commons-io:$commons_io_version" + compile "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/supportJava6}} + {{#threetenbp}} + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" + {{/threetenbp}} + {{^java8}} + compile "com.brsanthu:migbase64:2.2" + {{/java8}} + testCompile "junit:junit:$junit_version" +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.sbt.mustache new file mode 100644 index 0000000000..abb91ecdc9 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/build.sbt.mustache @@ -0,0 +1,38 @@ +lazy val root = (project in file(".")). + settings( + organization := "{{groupId}}", + name := "{{artifactId}}", + version := "{{artifactVersion}}", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.22", + "org.glassfish.jersey.core" % "jersey-client" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, + "org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.25.1"{{/supportJava6}}, + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + {{#joda}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.9.10" % "compile", + {{/joda}} + {{#java8}} + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.9.10" % "compile", + {{/java8}} + {{#threetenbp}} + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + {{/threetenbp}} + {{^java8}} + "com.brsanthu" % "migbase64" % "2.2", + {{/java8}} + {{#supportJava6}} + "org.apache.commons" % "commons-lang3" % "3.6", + "commons-io" % "commons-io" % "2.5", + {{/supportJava6}} + "junit" % "junit" % "4.13" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/model.mustache new file mode 100644 index 0000000000..02787f8bb7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/model.mustache @@ -0,0 +1,47 @@ +{{>licenseInfo}} + +package {{package}}; + +{{#useReflectionEqualsHashCode}} +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +{{/useReflectionEqualsHashCode}} +{{^supportJava6}} +import java.util.Objects; +import java.util.Arrays; +{{/supportJava6}} +{{#supportJava6}} +import org.apache.commons.lang3.ObjectUtils; +{{/supportJava6}} +{{#imports}} +import {{import}}; +{{/imports}} +{{#serializableModel}} +import java.io.Serializable; +{{/serializableModel}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +{{#withXml}} +import com.fasterxml.jackson.dataformat.xml.annotation.*; +{{/withXml}} +{{/jackson}} +{{#withXml}} +import javax.xml.bind.annotation.*; +{{/withXml}} +{{#parcelableModel}} +import android.os.Parcelable; +import android.os.Parcel; +{{/parcelableModel}} +{{#useBeanValidation}} +import javax.validation.constraints.*; +import javax.validation.Valid; +{{/useBeanValidation}} +{{#performBeanValidation}} +import org.hibernate.validator.constraints.*; +{{/performBeanValidation}} + +{{#models}} +{{#model}} +{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{#oneOf}}{{#-first}}{{>oneof_model}}{{/-first}}{{/oneOf}}{{^oneOf}}{{#anyOf}}{{#-first}}{{>anyof_model}}{{/-first}}{{/anyOf}}{{^anyOf}}{{>pojo}}{{/anyOf}}{{/oneOf}}{{/isEnum}} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/oneof_model.mustache new file mode 100644 index 0000000000..62289f9b2d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/oneof_model.mustache @@ -0,0 +1,45 @@ +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{>xmlAnnotation}} +public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-implements}}, {{{.}}}{{/vendorExtensions.x-implements}} { + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public {{classname}}() { + super("oneOf"); + } + + static { + {{#oneOf}} + schemas.put("{{{.}}}", new GenericType<{{{.}}}>() { + }); + {{/oneOf}} + } + + @Override + public Map getSchemas() { + return {{classname}}.schemas; + } + + public String getSchemaType() { + return schemaType; + } + + @Override + public void setActualInstance(Object instance) { + {{#oneOf}} + if (instance instanceof {{{.}}}) { + super.setActualInstance(instance); + return; + } + + {{/oneOf}} + throw new RuntimeException("Invalid instance type. Must be {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + } + +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pojo.mustache new file mode 100644 index 0000000000..c438cd43eb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pojo.mustache @@ -0,0 +1,369 @@ +/** + * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + */{{#description}} +@ApiModel(description = "{{{description}}}"){{/description}} +{{#jackson}} +@JsonPropertyOrder({ +{{#vars}} + {{classname}}.JSON_PROPERTY_{{nameInSnakeCase}}{{^-last}},{{/-last}} +{{/vars}} +}) +{{/jackson}} +{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +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}} +{{>modelInnerEnum}} + {{/isContainer}} + {{#isContainer}} + {{#mostInnerItems}} +{{>modelInnerEnum}} + {{/mostInnerItems}} + {{/isContainer}} + {{/isEnum}} + {{#gson}} + public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}"; + {{/gson}} + {{#jackson}} + public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}"; + {{/jackson}} + {{#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}} + {{#gson}} + @SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}}) + {{/gson}} + {{#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}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{/isContainer}} + {{/vendorExtensions.x-is-jackson-optional-nullable}} + + {{/vars}} + {{#parcelableModel}} + public {{classname}}() { + {{#parent}} + super(); + {{/parent}} + {{#gson}} + {{#discriminator}} + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + {{/discriminator}} + {{/gson}} + } + {{/parcelableModel}} + {{^parcelableModel}} + {{#gson}} + {{#discriminator}} + public {{classname}}() { + this.{{{discriminatorName}}} = this.getClass().getSimpleName(); + } + {{/discriminator}} + {{/gson}} + {{/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; + } + {{#isListContainer}} + + 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}} + } + {{/isListContainer}} + {{#isMapContainer}} + + 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}} + } + {{/isMapContainer}} + + {{/isReadOnly}} + /** + {{#description}} + * {{description}} + {{/description}} + {{^description}} + * Get {{name}} + {{/description}} + {{#minimum}} + * minimum: {{minimum}} + {{/minimum}} + {{#maximum}} + * maximum: {{maximum}} + {{/maximum}} + * @return {{name}} + **/ +{{#required}} +{{#isNullable}} + @javax.annotation.Nullable +{{/isNullable}} +{{/required}} +{{^required}} + @javax.annotation.Nullable +{{/required}} +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @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}}{{> 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}} +{{> jackson_annotations}} + public JsonNullable<{{{datatypeWithEnum}}}> {{getter}}_JsonNullable() { + return {{name}}; + } + {{/vendorExtensions.x-is-jackson-optional-nullable}}{{#vendorExtensions.x-is-jackson-optional-nullable}} + @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}} + 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}} + +{{^supportJava6}} + @Override + public boolean equals(java.lang.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}}){{#hasMore}} && + {{/hasMore}}{{/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}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + {{/useReflectionEqualsHashCode}} + } + +{{/supportJava6}} +{{#supportJava6}} + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + }{{#hasVars}} + {{classname}} {{classVarName}} = ({{classname}}) o; + return {{#vars}}ObjectUtils.equals(this.{{name}}, {{classVarName}}.{{name}}){{#hasMore}} && + {{/hasMore}}{{/vars}}{{#parent}} && + super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}} + return true;{{/hasVars}} + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti({{#vars}}{{name}}{{#hasMore}}, {{/hasMore}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}); + } + +{{/supportJava6}} + + @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 String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +{{#parcelableModel}} + + public void writeToParcel(Parcel out, int flags) { +{{#model}} +{{#isArrayModel}} + out.writeList(this); +{{/isArrayModel}} +{{^isArrayModel}} +{{#parent}} + super.writeToParcel(out, flags); +{{/parent}} +{{#vars}} + out.writeValue({{name}}); +{{/vars}} +{{/isArrayModel}} +{{/model}} + } + + {{classname}}(Parcel in) { +{{#isArrayModel}} + in.readTypedList(this, {{arrayModelType}}.CREATOR); +{{/isArrayModel}} +{{^isArrayModel}} +{{#parent}} + super(in); +{{/parent}} +{{#vars}} +{{#isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue(null); +{{/isPrimitiveType}} +{{^isPrimitiveType}} + {{name}} = ({{{datatypeWithEnum}}})in.readValue({{complexType}}.class.getClassLoader()); +{{/isPrimitiveType}} +{{/vars}} +{{/isArrayModel}} + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator<{{classname}}> CREATOR = new Parcelable.Creator<{{classname}}>() { + public {{classname}} createFromParcel(Parcel in) { +{{#model}} +{{#isArrayModel}} + {{classname}} result = new {{classname}}(); + result.addAll(in.readArrayList({{arrayModelType}}.class.getClassLoader())); + return result; +{{/isArrayModel}} +{{^isArrayModel}} + return new {{classname}}(in); +{{/isArrayModel}} +{{/model}} + } + public {{classname}}[] newArray(int size) { + return new {{classname}}[size]; + } + }; +{{/parcelableModel}} +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache new file mode 100644 index 0000000000..bf1c3648c2 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache @@ -0,0 +1,372 @@ + + 4.0.0 + {{groupId}} + {{artifactId}} + jar + {{artifactId}} + {{artifactVersion}} + {{artifactUrl}} + {{artifactDescription}} + + {{scmConnection}} + {{scmDeveloperConnection}} + {{scmUrl}} + +{{#parentOverridden}} + + {{{parentGroupId}}} + {{{parentArtifactId}}} + {{{parentVersion}}} + +{{/parentOverridden}} + + + + {{licenseName}} + {{licenseUrl}} + repo + + + + + + {{developerName}} + {{developerEmail}} + {{developerOrganization}} + {{developerOrganizationUrl}} + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + {{#supportJava6}} + 1.6 + 1.6 + {{/supportJava6}} + {{^supportJava6}} + {{#java8}} + 1.8 + 1.8 + {{/java8}} + {{^java8}} + 1.7 + 1.7 + {{/java8}} + {{/supportJava6}} + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + {{^supportJava6}} + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + + {{/supportJava6}} + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{#withXml}} + + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + + + {{/withXml}} + {{#joda}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + {{/joda}} + {{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{/java8}} + {{#threetenbp}} + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${threetenbp-version} + + {{/threetenbp}} + {{^java8}} + + + com.brsanthu + migbase64 + 2.2 + + {{/java8}} + {{#supportJava6}} + + org.apache.commons + commons-lang3 + ${commons_lang3_version} + + + commons-io + commons-io + ${commons_io_version} + + {{/supportJava6}} + {{#useBeanValidation}} + + + javax.validation + validation-api + 1.1.0.Final + provided + + {{/useBeanValidation}} + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.6.1 + {{^supportJava6}} + 2.30.1 + {{/supportJava6}} + {{#supportJava6}} + 2.6 + 2.5 + 3.6 + {{/supportJava6}} + 2.10.3 + 2.10.3 + 0.2.1 + {{#threetenbp}} + 2.9.10 + {{/threetenbp}} + 4.13 + + diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 9bd8925f00..d999ffaf0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -352,7 +352,7 @@ UTF-8 - 1.5.22 + 1.6.1 {{^supportJava6}} 2.27 {{/supportJava6}} 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 d43f7062e2..93ddc121df 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 @@ -1401,7 +1401,7 @@ public class DefaultCodegenTest { .get("application/json") .getSchema() .getExtensions() - .get("x-oneOf-name"), + .get("x-one-of-name"), "CreateState" ); Assert.assertEquals( @@ -1414,11 +1414,11 @@ public class DefaultCodegenTest { .get("application/json") .getSchema() .getExtensions() - .get("x-oneOf-name"), + .get("x-one-of-name"), "GetState200" ); // for the array schema, assert that a oneOf interface was added to schema map Schema items = ((ArraySchema) openAPI.getComponents().getSchemas().get("CustomOneOfArraySchema")).getItems(); - Assert.assertEquals(items.getExtensions().get("x-oneOf-name"), "CustomOneOfArraySchemaOneOf"); + Assert.assertEquals(items.getExtensions().get("x-one-of-name"), "CustomOneOfArraySchemaOneOf"); } } diff --git a/pom.xml b/pom.xml index df4f81ac4e..b9ff2c632c 100644 --- a/pom.xml +++ b/pom.xml @@ -1306,6 +1306,7 @@ samples/client/petstore/java/jersey1 samples/client/petstore/java/jersey2 samples/client/petstore/java/jersey2-java8 + samples/client/petstore/java/jersey2-experimental samples/client/petstore/java/okhttp-gson samples/client/petstore/java/retrofit samples/client/petstore/java/retrofit2 @@ -1399,6 +1400,7 @@ samples/client/petstore/java/feign samples/client/petstore/java/jersey1 samples/client/petstore/java/jersey2 + samples/client/petstore/java/jersey2-experimental samples/client/petstore/java/okhttp-gson samples/client/petstore/java/retrofit samples/client/petstore/java/retrofit2 diff --git a/samples/client/petstore/java/jersey2-experimental/.gitignore b/samples/client/petstore/java/jersey2-experimental/.gitignore new file mode 100644 index 0000000000..a530464afa --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/.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/client/petstore/java/jersey2-experimental/.openapi-generator-ignore b/samples/client/petstore/java/jersey2-experimental/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/client/petstore/java/jersey2-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/client/petstore/java/jersey2-experimental/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-experimental/.openapi-generator/VERSION new file mode 100644 index 0000000000..b5d898602c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-experimental/.travis.yml b/samples/client/petstore/java/jersey2-experimental/.travis.yml new file mode 100644 index 0000000000..e3bdf2af1b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/.travis.yml @@ -0,0 +1,22 @@ +# +# Generated by OpenAPI Generator: https://openapi-generator.tech +# +# Ref: https://docs.travis-ci.com/user/languages/java/ +# +language: java +jdk: + - openjdk12 + - openjdk11 + - openjdk10 + - openjdk9 + - openjdk8 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + #- mvn test + # test using gradle + - gradle test + # test using sbt + # - sbt test diff --git a/samples/client/petstore/java/jersey2-experimental/README.md b/samples/client/petstore/java/jersey2-experimental/README.md new file mode 100644 index 0000000000..a42ed132fe --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/README.md @@ -0,0 +1,238 @@ +# petstore-jersey2 + +OpenAPI Petstore + +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* + +## Requirements + +Building the API client library requires: + +1. Java 1.7+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + org.openapitools + petstore-jersey2 + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "org.openapitools:petstore-jersey2:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +- `target/petstore-jersey2-1.0.0.jar` +- `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java + +import org.openapitools.client.*; +import org.openapitools.client.auth.*; +import org.openapitools.client.model.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class AnotherFakeApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +*FakeApi* | [**createXmlItem**](docs/FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case +*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + +## Documentation for Models + + - [AdditionalPropertiesAnyType](docs/AdditionalPropertiesAnyType.md) + - [AdditionalPropertiesArray](docs/AdditionalPropertiesArray.md) + - [AdditionalPropertiesBoolean](docs/AdditionalPropertiesBoolean.md) + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [AdditionalPropertiesInteger](docs/AdditionalPropertiesInteger.md) + - [AdditionalPropertiesNumber](docs/AdditionalPropertiesNumber.md) + - [AdditionalPropertiesObject](docs/AdditionalPropertiesObject.md) + - [AdditionalPropertiesString](docs/AdditionalPropertiesString.md) + - [Animal](docs/Animal.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [BigCat](docs/BigCat.md) + - [BigCatAllOf](docs/BigCatAllOf.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelReturn](docs/ModelReturn.md) + - [Name](docs/Name.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [TypeHolderDefault](docs/TypeHolderDefault.md) + - [TypeHolderExample](docs/TypeHolderExample.md) + - [User](docs/User.md) + - [XmlItem](docs/XmlItem.md) + + +## Documentation for Authorization + +Authentication schemes defined for the API: +### api_key + + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### api_key_query + + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +### http_basic_test + + +- **Type**: HTTP basic authentication + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + + diff --git a/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml b/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml new file mode 100644 index 0000000000..30aad25824 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml @@ -0,0 +1,2183 @@ +openapi: 3.0.1 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/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: + 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 + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + put: + operationId: updatePet + requestBody: + 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 + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + 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 + responses: + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + 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 + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + 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": + content: {} + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: application/json + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Someting wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + responses: + "400": + content: {} + description: Invalid request + "404": + content: {} + description: Not found + summary: To test enum parameters + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-contentType: '*/*' + x-accepts: '*/*' + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + required: true + responses: + "200": + content: {} + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-contentType: application/x-www-form-urlencoded + x-accepts: application/json + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + content: {} + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-codegen-request-body-name: param + x-contentType: application/json + x-accepts: application/json + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-contentType: application/xml + x-accepts: application/json + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + x-accepts: application/json + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-contentType: multipart/form-data + x-accepts: application/json +components: + schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: $special[model.name] + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + type: object + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + type: object + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/BigCat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 1E+2 + minimum: 1E+1 + type: integer + int32: + format: int32 + maximum: 2E+2 + minimum: 2E+1 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + BigCat_allOf: + properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + diff --git a/samples/client/petstore/java/jersey2-experimental/build.gradle b/samples/client/petstore/java/jersey2-experimental/build.gradle new file mode 100644 index 0000000000..b21805a1dd --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/build.gradle @@ -0,0 +1,123 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'org.openapitools' +version = '1.0.0' + +buildscript { + repositories { + maven { url "https://repo1.maven.org/maven2" } + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + jcenter() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven' + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 + + install { + repositories.mavenInstaller { + pom.artifactId = 'petstore-jersey2-exp' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +ext { + swagger_annotations_version = "1.5.22" + jackson_version = "2.10.3" + jackson_databind_version = "2.10.3" + jackson_databind_nullable_version = "0.2.1" + jersey_version = "2.27" + junit_version = "4.13" + threetenbp_version = "2.9.10" +} + +dependencies { + compile "io.swagger:swagger-annotations:$swagger_annotations_version" + compile "com.google.code.findbugs:jsr305:3.0.2" + compile "org.glassfish.jersey.core:jersey-client:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" + compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version" + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version" + compile "com.brsanthu:migbase64:2.2" + testCompile "junit:junit:$junit_version" +} + +javadoc { + options.tags = [ "http.response.details:a:Http Response Details" ] +} diff --git a/samples/client/petstore/java/jersey2-experimental/build.sbt b/samples/client/petstore/java/jersey2-experimental/build.sbt new file mode 100644 index 0000000000..e77fd2df22 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/build.sbt @@ -0,0 +1,24 @@ +lazy val root = (project in file(".")). + settings( + organization := "org.openapitools", + name := "petstore-jersey2-exp", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger" % "swagger-annotations" % "1.5.22", + "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3" % "compile", + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.9.10" % "compile", + "com.brsanthu" % "migbase64" % "2.2", + "junit" % "junit" % "4.13" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesAnyType.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesAnyType.md new file mode 100644 index 0000000000..87b468bb7c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesAnyType.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesAnyType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesArray.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesArray.md new file mode 100644 index 0000000000..cb7fe9b390 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesArray.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesArray + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesBoolean.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesBoolean.md new file mode 100644 index 0000000000..6b53e7ba73 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesBoolean.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesBoolean + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md new file mode 100644 index 0000000000..36e1816200 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md @@ -0,0 +1,22 @@ + + +# AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapString** | **Map<String, String>** | | [optional] +**mapNumber** | [**Map<String, BigDecimal>**](BigDecimal.md) | | [optional] +**mapInteger** | **Map<String, Integer>** | | [optional] +**mapBoolean** | **Map<String, Boolean>** | | [optional] +**mapArrayInteger** | [**Map<String, List<Integer>>**](List.md) | | [optional] +**mapArrayAnytype** | [**Map<String, List<Object>>**](List.md) | | [optional] +**mapMapString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapMapAnytype** | [**Map<String, Map<String, Object>>**](Map.md) | | [optional] +**anytype1** | [**Object**](.md) | | [optional] +**anytype2** | [**Object**](.md) | | [optional] +**anytype3** | [**Object**](.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesInteger.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesInteger.md new file mode 100644 index 0000000000..d2ed7fb1a4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesInteger.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesNumber.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesNumber.md new file mode 100644 index 0000000000..53f6e81e71 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesNumber.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesNumber + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesObject.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesObject.md new file mode 100644 index 0000000000..98ac8d2e5f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesObject.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesString.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesString.md new file mode 100644 index 0000000000..d7970cdfe1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesString.md @@ -0,0 +1,12 @@ + + +# AdditionalPropertiesString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Animal.md b/samples/client/petstore/java/jersey2-experimental/docs/Animal.md new file mode 100644 index 0000000000..c8e18ae55e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Animal.md @@ -0,0 +1,13 @@ + + +# Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md new file mode 100644 index 0000000000..059616ec6b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md @@ -0,0 +1,74 @@ +# AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + + +## call123testSpecialTags + +> Client call123testSpecialTags(body) + +To test special tags + +To test special tags and operation ID starting with number + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.AnotherFakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.call123testSpecialTags(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 0000000000..a48aa23e78 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfNumberOnly.md new file mode 100644 index 0000000000..fa2909211a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ArrayOfNumberOnly.md @@ -0,0 +1,12 @@ + + +# ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ArrayTest.md b/samples/client/petstore/java/jersey2-experimental/docs/ArrayTest.md new file mode 100644 index 0000000000..9ad1c9814a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ArrayTest.md @@ -0,0 +1,14 @@ + + +# ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**arrayOfString** | **List<String>** | | [optional] +**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] +**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/BigCat.md b/samples/client/petstore/java/jersey2-experimental/docs/BigCat.md new file mode 100644 index 0000000000..8a075304ab --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/BigCat.md @@ -0,0 +1,23 @@ + + +# BigCat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/BigCatAllOf.md b/samples/client/petstore/java/jersey2-experimental/docs/BigCatAllOf.md new file mode 100644 index 0000000000..21177dbf08 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/BigCatAllOf.md @@ -0,0 +1,23 @@ + + +# BigCatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**kind** | [**KindEnum**](#KindEnum) | | [optional] + + + +## Enum: KindEnum + +Name | Value +---- | ----- +LIONS | "lions" +TIGERS | "tigers" +LEOPARDS | "leopards" +JAGUARS | "jaguars" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Capitalization.md b/samples/client/petstore/java/jersey2-experimental/docs/Capitalization.md new file mode 100644 index 0000000000..7b73c40b55 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Capitalization.md @@ -0,0 +1,17 @@ + + +# Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**smallCamel** | **String** | | [optional] +**capitalCamel** | **String** | | [optional] +**smallSnake** | **String** | | [optional] +**capitalSnake** | **String** | | [optional] +**scAETHFlowPoints** | **String** | | [optional] +**ATT_NAME** | **String** | Name of the pet | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Cat.md b/samples/client/petstore/java/jersey2-experimental/docs/Cat.md new file mode 100644 index 0000000000..39c2f864df --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Cat.md @@ -0,0 +1,12 @@ + + +# Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/CatAllOf.md b/samples/client/petstore/java/jersey2-experimental/docs/CatAllOf.md new file mode 100644 index 0000000000..1098fd900c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/CatAllOf.md @@ -0,0 +1,12 @@ + + +# CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**declawed** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Category.md b/samples/client/petstore/java/jersey2-experimental/docs/Category.md new file mode 100644 index 0000000000..613ea9f7ee --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Category.md @@ -0,0 +1,13 @@ + + +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ClassModel.md b/samples/client/petstore/java/jersey2-experimental/docs/ClassModel.md new file mode 100644 index 0000000000..d5453c2013 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ClassModel.md @@ -0,0 +1,13 @@ + + +# ClassModel + +Model for testing model with \"_class\" property +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Client.md b/samples/client/petstore/java/jersey2-experimental/docs/Client.md new file mode 100644 index 0000000000..228df49238 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Client.md @@ -0,0 +1,12 @@ + + +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Dog.md b/samples/client/petstore/java/jersey2-experimental/docs/Dog.md new file mode 100644 index 0000000000..73cedf2bc9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Dog.md @@ -0,0 +1,12 @@ + + +# Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/DogAllOf.md b/samples/client/petstore/java/jersey2-experimental/docs/DogAllOf.md new file mode 100644 index 0000000000..cbeb9e9a22 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/DogAllOf.md @@ -0,0 +1,12 @@ + + +# DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**breed** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/EnumArrays.md b/samples/client/petstore/java/jersey2-experimental/docs/EnumArrays.md new file mode 100644 index 0000000000..869b7a6c06 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/EnumArrays.md @@ -0,0 +1,31 @@ + + +# EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] +**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + + + +## Enum: JustSymbolEnum + +Name | Value +---- | ----- +GREATER_THAN_OR_EQUAL_TO | ">=" +DOLLAR | "$" + + + +## Enum: List<ArrayEnumEnum> + +Name | Value +---- | ----- +FISH | "fish" +CRAB | "crab" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/EnumClass.md b/samples/client/petstore/java/jersey2-experimental/docs/EnumClass.md new file mode 100644 index 0000000000..b314590a75 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/EnumClass.md @@ -0,0 +1,15 @@ + + +# EnumClass + +## Enum + + +* `_ABC` (value: `"_abc"`) + +* `_EFG` (value: `"-efg"`) + +* `_XYZ_` (value: `"(xyz)"`) + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md b/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md new file mode 100644 index 0000000000..61eb95f22f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md @@ -0,0 +1,54 @@ + + +# EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] +**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | +**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] +**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] +**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + + + +## Enum: EnumStringEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumStringRequiredEnum + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" +EMPTY | "" + + + +## Enum: EnumIntegerEnum + +Name | Value +---- | ----- +NUMBER_1 | 1 +NUMBER_MINUS_1 | -1 + + + +## Enum: EnumNumberEnum + +Name | Value +---- | ----- +NUMBER_1_DOT_1 | 1.1 +NUMBER_MINUS_1_DOT_2 | -1.2 + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md b/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md new file mode 100644 index 0000000000..543c51f066 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md @@ -0,0 +1,997 @@ +# FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | +[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | +[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | +[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | +[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | +[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters +[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) +[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties +[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data +[**testQueryParameterCollectionFormat**](FakeApi.md#testQueryParameterCollectionFormat) | **PUT** /fake/test-query-paramters | + + + +## createXmlItem + +> createXmlItem(xmlItem) + +creates an XmlItem + +this route creates an XmlItem + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body + try { + apiInstance.createXmlItem(xmlItem); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#createXmlItem"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## fakeOuterBooleanSerialize + +> Boolean fakeOuterBooleanSerialize(body) + + + +Test serialization of outer boolean types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Boolean body = true; // Boolean | Input boolean as post body + try { + Boolean result = apiInstance.fakeOuterBooleanSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **Boolean**| Input boolean as post body | [optional] + +### Return type + +**Boolean** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output boolean | - | + + +## fakeOuterCompositeSerialize + +> OuterComposite fakeOuterCompositeSerialize(body) + + + +Test serialization of object with outer number type + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + try { + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output composite | - | + + +## fakeOuterNumberSerialize + +> BigDecimal fakeOuterNumberSerialize(body) + + + +Test serialization of outer number types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + try { + BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **BigDecimal**| Input number as post body | [optional] + +### Return type + +[**BigDecimal**](BigDecimal.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output number | - | + + +## fakeOuterStringSerialize + +> String fakeOuterStringSerialize(body) + + + +Test serialization of outer string types + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String body = "body_example"; // String | Input string as post body + try { + String result = apiInstance.fakeOuterStringSerialize(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **String**| Input string as post body | [optional] + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: */* + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Output string | - | + + +## testBodyWithFileSchema + +> testBodyWithFileSchema(body) + + + +For this test, the body for this request much reference a schema named `File`. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + try { + apiInstance.testBodyWithFileSchema(body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testBodyWithQueryParams + +> testBodyWithQueryParams(query, body) + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String query = "query_example"; // String | + User body = new User(); // User | + try { + apiInstance.testBodyWithQueryParams(query, body); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **query** | **String**| | + **body** | [**User**](User.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + + +## testClientModel + +> Client testClientModel(body) + +To test \"client\" model + +To test "client" model + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.testClientModel(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testClientModel"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testEndpointParameters + +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP basic authorization: http_basic_test + HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); + http_basic_test.setUsername("YOUR USERNAME"); + http_basic_test.setPassword("YOUR PASSWORD"); + + FakeApi apiInstance = new FakeApi(defaultClient); + BigDecimal number = new BigDecimal(); // BigDecimal | None + Double _double = 3.4D; // Double | None + String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None + byte[] _byte = null; // byte[] | None + Integer integer = 56; // Integer | None + Integer int32 = 56; // Integer | None + Long int64 = 56L; // Long | None + Float _float = 3.4F; // Float | None + String string = "string_example"; // String | None + File binary = new File("/path/to/file"); // File | None + LocalDate date = new LocalDate(); // LocalDate | None + OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None + String password = "password_example"; // String | None + String paramCallback = "paramCallback_example"; // String | None + try { + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEndpointParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **BigDecimal**| None | + **_double** | **Double**| None | + **patternWithoutDelimiter** | **String**| None | + **_byte** | **byte[]**| None | + **integer** | **Integer**| None | [optional] + **int32** | **Integer**| None | [optional] + **int64** | **Long**| None | [optional] + **_float** | **Float**| None | [optional] + **string** | **String**| None | [optional] + **binary** | **File**| None | [optional] + **date** | **LocalDate**| None | [optional] + **dateTime** | **OffsetDateTime**| None | [optional] + **password** | **String**| None | [optional] + **paramCallback** | **String**| None | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## testEnumParameters + +> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) + +To test enum parameters + +To test enum parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List enumHeaderStringArray = Arrays.asList("$"); // List | Header parameter enum test (string array) + String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + List enumQueryStringArray = Arrays.asList("$"); // List | Query parameter enum test (string array) + String enumQueryString = "-efg"; // String | Query parameter enum test (string) + Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) + Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) + List enumFormStringArray = "$"; // List | Form parameter enum test (string array) + String enumFormString = "-efg"; // String | Form parameter enum test (string) + try { + apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testEnumParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] + **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] + **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] + **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] + **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] + **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid request | - | +| **404** | Not found | - | + + +## testGroupParameters + +> testGroupParameters().requiredStringGroup(requiredStringGroup).requiredBooleanGroup(requiredBooleanGroup).requiredInt64Group(requiredInt64Group).stringGroup(stringGroup).booleanGroup(booleanGroup).int64Group(int64Group).execute(); + +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Integer requiredStringGroup = 56; // Integer | Required String in group parameters + Boolean requiredBooleanGroup = true; // Boolean | Required Boolean in group parameters + Long requiredInt64Group = 56L; // Long | Required Integer in group parameters + Integer stringGroup = 56; // Integer | String in group parameters + Boolean booleanGroup = true; // Boolean | Boolean in group parameters + Long int64Group = 56L; // Long | Integer in group parameters + try { + api.testGroupParameters() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testGroupParameters"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **requiredStringGroup** | **Integer**| Required String in group parameters | + **requiredBooleanGroup** | **Boolean**| Required Boolean in group parameters | + **requiredInt64Group** | **Long**| Required Integer in group parameters | + **stringGroup** | **Integer**| String in group parameters | [optional] + **booleanGroup** | **Boolean**| Boolean in group parameters | [optional] + **int64Group** | **Long**| Integer in group parameters | [optional] + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Someting wrong | - | + + +## testInlineAdditionalProperties + +> testInlineAdditionalProperties(param) + +test inline additionalProperties + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + Map param = new HashMap(); // Map | request body + try { + apiInstance.testInlineAdditionalProperties(param); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | [**Map<String, String>**](String.md)| request body | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testJsonFormData + +> testJsonFormData(param, param2) + +test json serialization of form data + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + String param = "param_example"; // String | field1 + String param2 = "param2_example"; // String | field2 + try { + apiInstance.testJsonFormData(param, param2); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testJsonFormData"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **param** | **String**| field1 | + **param2** | **String**| field2 | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## testQueryParameterCollectionFormat + +> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context) + + + +To test the collection format in query parameters + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + FakeApi apiInstance = new FakeApi(defaultClient); + List pipe = Arrays.asList(); // List | + List ioutil = Arrays.asList(); // List | + List http = Arrays.asList(); // List | + List url = Arrays.asList(); // List | + List context = Arrays.asList(); // List | + try { + apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pipe** | [**List<String>**](String.md)| | + **ioutil** | [**List<String>**](String.md)| | + **http** | [**List<String>**](String.md)| | + **url** | [**List<String>**](String.md)| | + **context** | [**List<String>**](String.md)| | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | Success | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md new file mode 100644 index 0000000000..14a74a37a4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md @@ -0,0 +1,81 @@ +# FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + + +## testClassname + +> Client testClassname(body) + +To test class name in snake case + +To test class name in snake case + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeClassnameTags123Api; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key_query + ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); + api_key_query.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key_query.setApiKeyPrefix("Token"); + + FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); + Client body = new Client(); // Client | client model + try { + Client result = apiInstance.testClassname(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FileSchemaTestClass.md b/samples/client/petstore/java/jersey2-experimental/docs/FileSchemaTestClass.md new file mode 100644 index 0000000000..3a95e27d7c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/FileSchemaTestClass.md @@ -0,0 +1,13 @@ + + +# FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | [**java.io.File**](java.io.File.md) | | [optional] +**files** | [**List<java.io.File>**](java.io.File.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md b/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md new file mode 100644 index 0000000000..d138e92190 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md @@ -0,0 +1,25 @@ + + +# FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | | [optional] +**int32** | **Integer** | | [optional] +**int64** | **Long** | | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | | +**_float** | **Float** | | [optional] +**_double** | **Double** | | [optional] +**string** | **String** | | [optional] +**_byte** | **byte[]** | | +**binary** | [**File**](File.md) | | [optional] +**date** | [**LocalDate**](LocalDate.md) | | +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] +**password** | **String** | | +**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-experimental/docs/HasOnlyReadOnly.md new file mode 100644 index 0000000000..4795b40ef6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/HasOnlyReadOnly.md @@ -0,0 +1,13 @@ + + +# HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**foo** | **String** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/MapTest.md b/samples/client/petstore/java/jersey2-experimental/docs/MapTest.md new file mode 100644 index 0000000000..c35c3cf2c0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/MapTest.md @@ -0,0 +1,24 @@ + + +# MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] +**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] +**directMap** | **Map<String, Boolean>** | | [optional] +**indirectMap** | **Map<String, Boolean>** | | [optional] + + + +## Enum: Map<String, InnerEnum> + +Name | Value +---- | ----- +UPPER | "UPPER" +LOWER | "lower" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 0000000000..3dc283ae49 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,14 @@ + + +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | [**UUID**](UUID.md) | | [optional] +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**map** | [**Map<String, Animal>**](Animal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Model200Response.md b/samples/client/petstore/java/jersey2-experimental/docs/Model200Response.md new file mode 100644 index 0000000000..f9928d7062 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Model200Response.md @@ -0,0 +1,14 @@ + + +# Model200Response + +Model for testing model name starting with number +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | [optional] +**propertyClass** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2-experimental/docs/ModelApiResponse.md new file mode 100644 index 0000000000..14fb7f1ed2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ModelApiResponse.md @@ -0,0 +1,14 @@ + + +# ModelApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **Integer** | | [optional] +**type** | **String** | | [optional] +**message** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ModelReturn.md b/samples/client/petstore/java/jersey2-experimental/docs/ModelReturn.md new file mode 100644 index 0000000000..5005d4b723 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ModelReturn.md @@ -0,0 +1,13 @@ + + +# ModelReturn + +Model for testing reserved words +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_return** | **Integer** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Name.md b/samples/client/petstore/java/jersey2-experimental/docs/Name.md new file mode 100644 index 0000000000..b815a0b4c9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Name.md @@ -0,0 +1,16 @@ + + +# Name + +Model for testing model name same as property name +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **Integer** | | +**snakeCase** | **Integer** | | [optional] [readonly] +**property** | **String** | | [optional] +**_123number** | **Integer** | | [optional] [readonly] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-experimental/docs/NumberOnly.md new file mode 100644 index 0000000000..1c12b6adf3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/NumberOnly.md @@ -0,0 +1,12 @@ + + +# NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Order.md b/samples/client/petstore/java/jersey2-experimental/docs/Order.md new file mode 100644 index 0000000000..409fc4cc96 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Order.md @@ -0,0 +1,27 @@ + + +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**petId** | **Long** | | [optional] +**quantity** | **Integer** | | [optional] +**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] +**complete** | **Boolean** | | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +PLACED | "placed" +APPROVED | "approved" +DELIVERED | "delivered" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-experimental/docs/OuterComposite.md new file mode 100644 index 0000000000..e062922188 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/OuterComposite.md @@ -0,0 +1,14 @@ + + +# OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**myString** | **String** | | [optional] +**myBoolean** | **Boolean** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/OuterEnum.md b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnum.md new file mode 100644 index 0000000000..1f9b723eb8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnum.md @@ -0,0 +1,15 @@ + + +# OuterEnum + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Pet.md b/samples/client/petstore/java/jersey2-experimental/docs/Pet.md new file mode 100644 index 0000000000..37ac007b79 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Pet.md @@ -0,0 +1,27 @@ + + +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | [optional] +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md b/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md new file mode 100644 index 0000000000..875a8e6783 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md @@ -0,0 +1,656 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image +[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +## addPet + +> addPet(body) + +Add a new pet to the store + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.addPet(body); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **405** | Invalid input | - | + + +## deletePet + +> deletePet(petId, apiKey) + +Deletes a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | Pet id to delete + String apiKey = "apiKey_example"; // String | + try { + apiInstance.deletePet(petId, apiKey); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#deletePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| Pet id to delete | + **apiKey** | **String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid pet value | - | + + +## findPetsByStatus + +> List<Pet> findPetsByStatus(status) + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List status = Arrays.asList("available"); // List | Status values that need to be considered for filter + try { + List result = apiInstance.findPetsByStatus(status); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByStatus"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid status value | - | + + +## findPetsByTags + +> List<Pet> findPetsByTags(tags) + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + List tags = Arrays.asList(); // List | Tags to filter by + try { + List result = apiInstance.findPetsByTags(tags); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#findPetsByTags"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**List<String>**](String.md)| Tags to filter by | + +### Return type + +[**List<Pet>**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid tag value | - | + + +## getPetById + +> Pet getPetById(petId) + +Find pet by ID + +Returns a single pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to return + try { + Pet result = apiInstance.getPetById(petId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#getPetById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | + + +## updatePet + +> updatePet(body) + +Update an existing pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + try { + apiInstance.updatePet(body); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Pet not found | - | +| **405** | Validation exception | - | + + +## updatePetWithForm + +> updatePetWithForm(petId, name, status) + +Updates a pet in the store with form data + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet that needs to be updated + String name = "name_example"; // String | Updated name of the pet + String status = "status_example"; // String | Updated status of the pet + try { + apiInstance.updatePetWithForm(petId, name, status); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#updatePetWithForm"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet that needs to be updated | + **name** | **String**| Updated name of the pet | [optional] + **status** | **String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **405** | Invalid input | - | + + +## uploadFile + +> ModelApiResponse uploadFile(petId, additionalMetadata, file) + +uploads an image + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + File file = new File("/path/to/file"); // File | file to upload + try { + ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + **file** | **File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## uploadFileWithRequiredFile + +> ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) + +uploads an image (required) + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.PetApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure OAuth2 access token for authorization: petstore_auth + OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); + petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); + + PetApi apiInstance = new PetApi(defaultClient); + Long petId = 56L; // Long | ID of pet to update + File requiredFile = new File("/path/to/file"); // File | file to upload + String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server + try { + ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **Long**| ID of pet to update | + **requiredFile** | **File**| file to upload | + **additionalMetadata** | **String**| Additional data to pass to server | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2-experimental/docs/ReadOnlyFirst.md new file mode 100644 index 0000000000..a692499dc6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/ReadOnlyFirst.md @@ -0,0 +1,13 @@ + + +# ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] [readonly] +**baz** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-experimental/docs/SpecialModelName.md new file mode 100644 index 0000000000..934b8f0f25 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/SpecialModelName.md @@ -0,0 +1,12 @@ + + +# SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**$specialPropertyName** | **Long** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md b/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md new file mode 100644 index 0000000000..6625d5969e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md @@ -0,0 +1,276 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +## deleteOrder + +> deleteOrder(orderId) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + try { + apiInstance.deleteOrder(orderId); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#deleteOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## getInventory + +> Map<String, Integer> getInventory() + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure API key authorization: api_key + ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); + api_key.setApiKey("YOUR API KEY"); + // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) + //api_key.setApiKeyPrefix("Token"); + + StoreApi apiInstance = new StoreApi(defaultClient); + try { + Map result = apiInstance.getInventory(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getInventory"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**Map<String, Integer>** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | + + +## getOrderById + +> Order getOrderById(orderId) + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Long orderId = 56L; // Long | ID of pet that needs to be fetched + try { + Order result = apiInstance.getOrderById(orderId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#getOrderById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid ID supplied | - | +| **404** | Order not found | - | + + +## placeOrder + +> Order placeOrder(body) + +Place an order for a pet + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.StoreApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + StoreApi apiInstance = new StoreApi(defaultClient); + Order body = new Order(); // Order | order placed for purchasing the pet + try { + Order result = apiInstance.placeOrder(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling StoreApi#placeOrder"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid Order | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Tag.md b/samples/client/petstore/java/jersey2-experimental/docs/Tag.md new file mode 100644 index 0000000000..f24eba7d22 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Tag.md @@ -0,0 +1,13 @@ + + +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**name** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderDefault.md b/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderDefault.md new file mode 100644 index 0000000000..a338fc900c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderDefault.md @@ -0,0 +1,16 @@ + + +# TypeHolderDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | [**BigDecimal**](BigDecimal.md) | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderExample.md b/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderExample.md new file mode 100644 index 0000000000..f8858da606 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/TypeHolderExample.md @@ -0,0 +1,17 @@ + + +# TypeHolderExample + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**stringItem** | **String** | | +**numberItem** | [**BigDecimal**](BigDecimal.md) | | +**floatItem** | **Float** | | +**integerItem** | **Integer** | | +**boolItem** | **Boolean** | | +**arrayItem** | **List<Integer>** | | + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/User.md b/samples/client/petstore/java/jersey2-experimental/docs/User.md new file mode 100644 index 0000000000..c4ea94b7fc --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/User.md @@ -0,0 +1,19 @@ + + +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**username** | **String** | | [optional] +**firstName** | **String** | | [optional] +**lastName** | **String** | | [optional] +**email** | **String** | | [optional] +**password** | **String** | | [optional] +**phone** | **String** | | [optional] +**userStatus** | **Integer** | User Status | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md b/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md new file mode 100644 index 0000000000..ca9f550c31 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md @@ -0,0 +1,525 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +## createUser + +> createUser(body) + +Create user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + User body = new User(); // User | Created user object + try { + apiInstance.createUser(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithArrayInput(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## createUsersWithListInput + +> createUsersWithListInput(body) + +Creates list of users with given input array + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + List body = Arrays.asList(); // List | List of user object + try { + apiInstance.createUsersWithListInput(body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUsersWithListInput"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## deleteUser + +> deleteUser(username) + +Delete user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be deleted + try { + apiInstance.deleteUser(username); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## getUserByName + +> User getUserByName(username) + +Get user by user name + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. + try { + User result = apiInstance.getUserByName(username); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserByName"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | - | +| **400** | Invalid username supplied | - | +| **404** | User not found | - | + + +## loginUser + +> String loginUser(username, password) + +Logs user into the system + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | The user name for login + String password = "password_example"; // String | The password for login in clear text + try { + String result = apiInstance.loginUser(username, password); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#loginUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| The user name for login | + **password** | **String**| The password for login in clear text | + +### Return type + +**String** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    | +| **400** | Invalid username/password supplied | - | + + +## logoutUser + +> logoutUser() + +Logs out current logged in user session + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + try { + apiInstance.logoutUser(); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#logoutUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | successful operation | - | + + +## updateUser + +> updateUser(username, body) + +Updated user + +This can only be done by the logged in user. + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.UserApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + UserApi apiInstance = new UserApi(defaultClient); + String username = "username_example"; // String | name that need to be deleted + User body = new User(); // User | Updated user object + try { + apiInstance.updateUser(username, body); + } catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **400** | Invalid user supplied | - | +| **404** | User not found | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/XmlItem.md b/samples/client/petstore/java/jersey2-experimental/docs/XmlItem.md new file mode 100644 index 0000000000..6065fd1f4e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/XmlItem.md @@ -0,0 +1,40 @@ + + +# XmlItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributeString** | **String** | | [optional] +**attributeNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**attributeInteger** | **Integer** | | [optional] +**attributeBoolean** | **Boolean** | | [optional] +**wrappedArray** | **List<Integer>** | | [optional] +**nameString** | **String** | | [optional] +**nameNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**nameInteger** | **Integer** | | [optional] +**nameBoolean** | **Boolean** | | [optional] +**nameArray** | **List<Integer>** | | [optional] +**nameWrappedArray** | **List<Integer>** | | [optional] +**prefixString** | **String** | | [optional] +**prefixNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**prefixInteger** | **Integer** | | [optional] +**prefixBoolean** | **Boolean** | | [optional] +**prefixArray** | **List<Integer>** | | [optional] +**prefixWrappedArray** | **List<Integer>** | | [optional] +**namespaceString** | **String** | | [optional] +**namespaceNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**namespaceInteger** | **Integer** | | [optional] +**namespaceBoolean** | **Boolean** | | [optional] +**namespaceArray** | **List<Integer>** | | [optional] +**namespaceWrappedArray** | **List<Integer>** | | [optional] +**prefixNsString** | **String** | | [optional] +**prefixNsNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] +**prefixNsInteger** | **Integer** | | [optional] +**prefixNsBoolean** | **Boolean** | | [optional] +**prefixNsArray** | **List<Integer>** | | [optional] +**prefixNsWrappedArray** | **List<Integer>** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/git_push.sh b/samples/client/petstore/java/jersey2-experimental/git_push.sh new file mode 100644 index 0000000000..ced3be2b0c --- /dev/null +++ b/samples/client/petstore/java/jersey2-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/client/petstore/java/jersey2-experimental/gradle.properties b/samples/client/petstore/java/jersey2-experimental/gradle.properties new file mode 100644 index 0000000000..05644f0754 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..cc4fdc293d0e50b0ad9b65c16e7ddd1db2f6025b GIT binary patch literal 58702 zcma&OV~}W3vL#%;<*Hk@ZQHhO+qTVHwr$(CZQFL$+?np4n10i5zVAmKMC6WrGGd+F zD|4@NHj-D$z)bJV;MYNJ&!D%)v-fQ%q0JG$_z5GVUJTPg0MHPf1TvicY#6DXYBBQ4M`$iC~gA;06+%@0HFQPLj-JXogAJ1j+fRqw^4M` zcW^RxAfl%+w9SiS>QwBUTAfuFAjPXc2DHf6*sr+V+jLQj^m@DQgHTPmAb@F z8%GyCfcQkhWWlT31%4$PtV4tV*LI?J#C4orYI~WU(cSR{aEs^ycxY`1>j1po>yDMi zh4W$pMaecV*mCsOsPLxQ#Xc!RXhpXy*p3S2Hl8t}H7x#p5V6G5va4jV;5^S^+>+x&#zzv4!R}wB;)TyU zE_N~}nN>DTG+uZns%_eI=DL1E#<--Sccx30gvMT}^eu`2-u|{qQZ58(rA2aBYE*ZD zm|*12zg*@J$n|tbH%Mp|d|O9W%VT~xG})R=Ld5z<(z%DOO6=MF3Xh-aF%9Hf$?1N9%8Pkev{wun$jZ2 z^i*EhRt8Ve<7`Wyz~iMZDye+XVn}O%qbhV`wHL+%P+n)K&-UMuZw^RRfeQ)%K=k*m zq5l7mf`4K_WkV5B73~MxajljrjGiJqpiV#>0FkyyrB)@HY!;Ln(7JJ*W(>d5#^ubU zVAkTMs*CHzzvUa^nRu0*f-(ek+VZw+@P~}a;;(K=|!9Mhv(~y-mlW);J zb&bB=vySHG`u?j&_6dh^*se*l_B3avjlE|!!Cb0pXyEXRbLy*@WEQ4|)M<`p8Q!rfDJ2RI!u1hPzNjy&)(kcY~GaD6?)7#dCbm`NFh?Y_g$#!+Qrie7%<7P}<-+W@{sxi4JYI{iY zk0(>m$DxOI=~-&eXf2bfh^&(U@o)>(iA1_wJ%B(+nFH+ceib%HEck32QL=J(BNFh`f>St1%llF8chX7#cp*;z}& zcTeXkwsXhf+e;##!FS2yi=2cChcYfzm$wQJ z9%4kAq)wLHf5wfcj!A|xDsAiAOHRzf*)Z-|daN9y5jK-*R{Q0?xaSX-3m|WeuZ`BJ z>eTi@uQ{OGSDIJ#Iu@JPtOy!C?q)g*6SHORg)eAJGh8b-I*X_+xNqZ|OXEsQ-RWte ze`zjjeV9PpE3ac2za+Rs=PA;%QZ>T{x(TRzwWLp_X^2yC-DOEMUy5So!npzL&-@}u z#>uK#&`i&c%J$!bsntEJhY@rF(>6eY;6RoI5Qkn!&<80X5+1(x$T|wR-ad?4N1N^a0)nBj#&EkVvQ?I_+8t*%l#VK&I?uo$ERI1HMu4P2rLMeH%m3 zZ|HA^*O^dA$gb$`Cw;z9?G?m3@nH6TNYJ04Fd-M2wp8@(;vAvJ ztFoni)BLwncQ3@cO*^+6u;(&D<;N;RKb)_NQ_Qu&?@h3MWvo>6FHG%%*smTwj3;dG zQJnT7Wb?4!XmV^>N@ZkA7Jv9kAfD-gCHu2i+!A!}y98SO><8g}t;1JOOxj>#l zM!?y|j5fR3WY2(&_HSGjgMa?Zif<M@d8W z)4>Ptm@zj|xX=bbt$=j}@a_s|xdp6-tRlq6D|xb_;`9oJlkYF1AH%?Pzv$eIAogMi zf(_H*5t({Arfs5XAPj46pjiudQw?dulW-=OUqBVa)OW9E;^R+NDr&LES&m_nmP>Ga zPf)7_&Gn(3v1qu_a^qW9w4#XIEfgiHOQ(LDi=E&(-DcUSfuQE0`ULsRvS}fpS@<)3 z|CbQSi49rU{<4|XU;kiV|C7}Gld$}Yh5YXjg^W$~ovobybuZ^&YwBR^=qP3G=wxhT z?C_5Trbu~95mOoIXUmEOY646_j4ZL)ubCM{qFkl1u*%xs%#18a4!(*b<&edy<8t2w z_zUxWS5fypUp9ue+eswoJSyv*J&=*3;2;q9U?j>n^q?)}c8+}4Ns8oToBJgD;Ug=y zOa0>{VFrLJutjR{PJmm(P9lPzoPi{K!I{l)pGwDy59p-uxHB9I&7zl11lkCu(}*A< zh492AmxsgwEondBpB^{`I*L&Ut40fjM^JS8VdAWQMlwc>_RUM5|Mjes!36DGqW`xs z4tU4`CpOk|vew8!(L}fEvv5&-3#GqZ(#1EZF4ekDQ@y*$tMDEeG?nOUiS-KXG=rAZ zHUDlMo@X&yzo1TdE6b6!s#f{*45V-T3`e2)w5Ra3l>JWf46`v?Y6B&7*1$eS4M(3% z9C~G@N@RXm)8~EXL*9IObA+PwD)`%64fON_8}&pqjrg|2LmP{W^<0@W`9s^*i#F}V;E8~`-}(4@R4kz?t(RjA;y-r%s^=)15%C> zbF;NZET~nybEsmUr8sH^Hgq^xc^n$ZP=GcZ!-X-Go7J4nByj8%?aQ`c{88;p15Kf>|0h+5BLkM&@KI-(flp^npO3MC~W@Uyjv* z6Hu!4#(NtZJ0*;_{8^xcLrC4-zK$BVo7S5V=eg?R8P;BOpK3Xwms+Jt-8R6us zf_rUHFYHn~lu!)U$e$#%UBz7d8YS;mq}xx$T1PIi=4={c-_cY6OVc<=){mOVn>~J$ zW*2PB%*40eE^c+d=PP7J@bqIX_h4u6b6#W|ir<;IlR`#s`Q*_Z8Q?*s_&emuu8D;NSiPX9mK?>$CwcbjhCuv zO&u(0)@}8nZe=Fl*0uMri02oYDjs#g$OHCZ6oTXV2Y0TrZ}+o%{%i)OAJBj2xHC|F5o+`Qmq`$`2EaL=uePwq%k<;6S2n=w%_9vj$8NO|{` zTEg*tK8PU#DnQ#dQ2mMJaaL|HV;BCn?eQ%d0vY@S7Pu@7 zsf5u`T=bL7NfyYO?K^PR_|jap@K|qQ zmO8CK+&O3fzgEnp2|_=^K9ln~QhxjgMM>EQqY@k@@#np@FnZq|C{EyEP7^NurUm0q zW5rKmiy%__KE>YItATyMhE({0%ve10la=mUd<^AcB{T_$Y`2_N-x;F#3xTORXvhPZ7psmqhXy?WxxB5w!m*4&Q;?t$4Kt?m_em-htVDxora24&6~5z$MG(RT{trtp(L( zy&VDT{@p9_DGoq+I|abw$E!TyTO7j6dWQ25dqdKV*z3E?n-p|IG42ZUnNok? zY4K{y{27bUT@#|Zcni!tIgjE`j=-0rl(tVlWEn>5x7BJBkt0iw6j^4n1f2i^6ebo; zt^&Yb##}W0$3xhH&Nz*nANYpO$emARR6-FWX;C?(l7+}<97Ay#!y%BI6^st=LaJ>n zu{ORVJ9%`f*oy85MUf@Fek@T_+ML0-0b$lkEE2y8h%#P^X6+cn)IEXa@T7CQ{fV z-{^wJGN*+T!NsAH@VNM3tWG;%y{pVF2m z2*0+i?o40zSKVq_S18#=0RrJIse+;5cv#a`*`wNs+B%Ln8#e0v^I>7a_33h?lHo14 zg)CbDfGMyH2cj%7C`>|Rrg;U?$&y!z(U10>(dHKQsf9*=z)&@9u@w%y+e@*CnUS|E z*O^cQqM*!sD|e!u(yhXPi$Sl<$daf3sq@Iexafxt3F#2R&=cK z!gT-qto{oVdGUIxC0q`tg)B-Zy(pxGx}&svoA}7p=}jb3jEjQ!v6=afKI!2`&M{#tY$~3LR}#G#U2up2L{} zMGSX>Yjg6-^vWgeX0i;Nb0=gQmYa!|r0rRUshm2+z3AlehjfTqRGnRAmGhHY3`R_@ zPh4GAF@=nkRz;xMO3TPh$)9Iq?Fs5B@~)QIntSyeBy^10!ts?9Z@tK&L6xJd9 zNzaaz6zvrtr&MPQ@UD)njFUtFupwB zv+8%r`c@#asm}cKW^*x0%v_k3faHOnRLt7vzVFlqslue32rt(NNXnkS+fMSM&^u)8 zC`p{on>0pf=1id|vzdTnBLB;v%*ta`o_lzj21u+U-cTRXR%sxE%4k<(bU!orfsJ&v z3FLM2UT_*)BJm1^W;Z{0;z^_e=N&QXSO>rdB`*cp>yGnjHJt$ zcJd~52X&k1b<-`2R{bqLm*E(W{=|-)RTB*i$h4TdV12@beTkR&*iJ==ck*QlFiQ52 zBZ|o_LP06C?Sgs3VJ=oZQU0vK6#}f9gHSs)JB7TU2h~}UVe%unJA!URBgJ# zI~26)lGD4yk~ngKRg;(s4f@PccDZaL{Y=%6UKHl&k|M@Zc4vdx-DX4{belQ);URF? zyxW+|Ziv}%Y!sFdY@YO))Z|f34L(WjN*v#EfZHn6m)X@;TzQ@wIjl4B_TieZY}qY`mG}3VL{w?; z&O>sZ8)YnW+eLuW@rhClOOCZe2YP@4YWKN?P{c~zFUj*U?OayavPUo!r{uqA1<8h! zs0=rKKlwJYk~34F9$q6fQ&jnw_|@cTn{_kA8sUZ#2(Lb@R$NL*u>08yYGx{p6OeX~ zr7!lwGqMSury(v5=1_9%#*MORl2apGf(MQIQTMN35yE3l`^OS7r;SKS6&v-5q}Gw* zNWI*4OKBD&2YbCr8c{ifn~-9w-v+mV49W+k)$jjU@WA+Aok01SA#X$Sspj}*r52!- zNqOS<0%uMUZeSp+*i1TEO$KGKn7EwzW=s?(b5X^@3s5k*80ns2I2|bTHU+bWZ$x;j z`k@>)1G#JgT=F!8awgol?DqK^S4R*g?e}2rOYRVMUKKxSudO(hOLnnL zQqpxPNouLiQFYJs3?7!9f6!-#Pi83{q3-GgOA|{btKup4fYDu-JFOK~Q1c3KD@fdJ z?uABYOkHA^Fc~l0gTAy4geF<-1UqdS=b=UM6Xi30mPhy1-f^aQh9H(jwFl5w*X`Mh z=Ee5C?038GEqSVTd!67bn9*zQg-r8RIH3$$ zf8vWEBbOc`_0U{b)t)Toa~~<7c-K_=G%*iTW^?6mj9{#)@|# zku9R^IDzbzzERz~fpxFrU*it;-Iu&m!CAtM&$)6^2rMyV4 z$+e!$(e)!UY(Sc9n6hkr^n&cvqy8}NfZz+AQc8fU9lNczlP>5D3qzWoR55YvH94^* z-S%SVQ96pK3|Yo`75D&85)xij9Dl8AO8{J*{_yhs-KtsLXUYqwieO(nfrkB@%|OyI>yF+1G?m7>X&djb(HBNNw3KX;Ma*oMV)cV0xzxmIy+5>yz>l_LLH)VyRnYYce zw$?q!hJzX0TlE0+o5QJDM~sPrjVCN7#|32#rUkc>?-eN6Q0RqQTAl~`&isrQg)ass z+x5XapaYh{Dj`+V096?w)w2!Cnmh?x1WmFC$jEFY4;V)XAl3*tBS)V)3TbL)g46_g zCw9pl^!3OCTOcaEP!?==guEAw;VZ}fE6K-;@qD-Rx~td+j(N>)Wv$_mqFTH_wVZNEEuDG!0T`HXLsf+_E=X3lw4`_&d5&YMl%H733ckO){vZm znFLS`;5J#^`5~unet`V#*Y5In3yb|Ax z|A6b^F37!_z$_{6h{7l~<{u7{Fx*A*#zw{GD)6e}n6f<|)&7`S-txiz3Jm4S5hV&8 zm|Ncc{j_~`^pQ*I#w21;(jwi8GnH4efO;R|r4$tH~i;Bcmp^sP9) zjhJne@yzU&XvFNoc~i(wQ?nE`o6Hk~!;x(%xh7?zvigH2g`!v8L-vEN0DvV3?m( zSW(TZ%2AWf`rS}GGMqUj!8yCp#|fR--Vxfj=9}YD97Gocdj=S z0zkF-jsO>EcPTB1zRO$++k^bH%O`=UkHdHT^5?{$)ot<-K2XIE7js*4OjF)BsVjCJ z*KN)!FdM*sh=fB$p8*EzZmGJp?B_=a-90$FI{S$LLjBU$(lxUj;9 zIBszmA*129W+YE;Yy{J~3uyOr<2A(`*cu0IJN#tmUfz2jIWQi_h)_-V6o+5CjbX!1$lz6?QYU za&|O#F%~hmGUhil{M+J|*0<3&{a1%ONp-^!Qx*LOTYY}L!r9BbTxCjHMuUR0E(uH` z!b$*ZMdnB{b2vsb<&P6})+%O=%a8@~$fjbtfF@Z>^Q@enTOJ%VT)Rdc!wX|@iq9i}HaFZAeY6g8xGZY7h-r1sy_<#YU6}I?L zwvf0ePE5PKbK>2RiJOFO5xNhMY+kt`Qi?Oxo&@xH$<^Q;Nb(&rjPBAcv;XtmSY90z z;oIFFl%lDq$o&kYQ;aSHZHD@W({Y1hw<-I>7f_X8wc?%hNDlo~Ig;63RlHNhw~#R3 zA*f5D_Qo`4_ajY4Gr{mLs*(Fxh(U%oua_u3r%`H!TI)@R!!iqV8IOhIOzI@=7QJ=G zV$(9mEVL(7DvPn0j%_cOZN|vvNg8*PHma`6+oS;PDz%iOFyo0n0e%$<#A3r~$=I0T zDL*{AREUGx&C2}?I9cVL`UcPyawTqA4j-4%Mr-4`9#8GX1jiJkKGpHVr1~Rj#zFaZ zqmE!<|1JCi!LDG?1^Ys62xz(p;Uu!QZB7!C0#piy1_9=e?^s@-sd1gs!h$;Q`TNtf z3N4Elsgl#={#U`~&}FNvH78MLjjavl1x*4pNVr338>%sfHu>bxo2#eZN2ee9q#*Jg zDk_=OBR;8t6=pBN0aj)&Nj}pzqqUYW(tfk?bXTdKbNQFSUMCyN-!b0#3?Z;ijzx$M z^Eo6Eq*NO!Y8K;84H4MHj_xwBYc|3>+D(PFj7ejhECG@5@Pk&8dG<)HwwO2~j7KV6 z0$s}=*D;ek#8$a*sxVlC_`qFkM0%BQQ@v2H&Aq@G9XCQt^^x<8w*=MbZV)@aPrrn; z`6r*&f`x&1lp)`5>-|-4%l&W4jy~LydfN;iq?Y8Xx>Sh#2Lx@FXo|5{WKp@y-x;)7 zl;;_Y*-Nu3pcH-)p0(tP~3xO_u~>HpCdEfgyq7V-!ZZ{?`6v_b-vx< zuu|gm5mG6c@D{FYMLuzvG+A2T&6&`n>XM%s`+Qtj)5XdpyFOnz3KLSCOxaCEUl()M z3b~FYqA3FT1#SY{p36h%M^gBQpB2QzEdtM9hMBMRMu{|rf}(;S85&|A!|Aj}?fMKaju!y>_AS}#hRe_!&%8V=6+oPPtE zOOJ-Rcrf>hNq@lG{{@$H?6ikt@!A2OePLe{MBIWSPz7{u(I} z$PXzD;leHG?Xl0FnWt+Wrkrk*|e3P~YVF@N$y&L929cc=#-!*k)HZKDo8!#+t|?9p0z1KSDKclB&M6~hN5<9~^DIltXKR$+iK*h9k$|@Qoy9H}PSI;b(v>w`8(k70@sfa4nRweeiwZ-syP3zPSsyK_8Te9*(FQdm+ z84ZDah4PGehH72w=Q8bx;pK5juT67rJKb|ovD#COI^l6z0eBidn$!Y?T2;5sN+vTV z$`%Edb<%-Oq@NPZy<2Z3m;$}!9JzIuVK6;fJi>>m3q!Lr!2xXRq+l0LvZIR_PNYrP57E#sCvD^4UU2GVr*Rx`QcT}yQanF z3i~!-2Vkk4S%4Hd2baDvrM2g(&1jZaA1!vLi!I#5wX6g^&PE`0-TovM(%wuaPXAno z`a&j{ai=TsgKpc1C3|)tY#!4>SPBbMnchi}glCBwaNE(4`gi}JY0;`|m`s{HtaP@& zHxwCt#2&z9A7O+=v>za}LW~}G>_tWo$dsRX)f1L=+tZF5E&RBA#jUC|N9ZPa_&z5= zekCOsIfOh`p(&S8dnkE~9#(;BAh8qzi5JYT0nP7x&Hga3v`XFdRN|$5Ry#mq*AN$J zV)l~LSq}2d{EJ@%{TLnkRVn*sdM{_b|4!x73|Ux9{%S;FPyhfZ{xg;P2ZmMuA*cMG zipYNeI7{u98`22!_phwRk|lyX#49r%Lq1aZAabxs6MP79J3Kxh0z1E>MzLS6Ee5u+ z@od~O#6yMa;R}eI*a|ZB$ar0BT`%X4+kyxqW4s+D3rV176EAsfS**6-swZ9OIPRZ& zlmIH>ppe;l28`Kd0z(alw^r<%RlDpI6hv)6Gs?GIpffKApgx^)2-6jAzjZE0BtPBC z0z8!#C5AP${zTF$-Z^v%^ie8LI*rvR+*xc=>fa;`SRUSLAio?qL;jVFV1Bw4K>D+i zyEQ}vyG2HTx>W?Ul&MhxUXK7n;yfN)QS`foM!4>4-(PGwxW!^^UyKOz(v+1BejI*& zQSkV|m5=JF4T0k*+|h|3dx`ZKBVX7H4{5iakAxnD#J=9igW@LS;HE_8$lZy1l|$wX zn<8-$u=7&li+^MB(1y~Mz7lj7?oYf%1k{wT#?(Mep094qqnPv7*OYkQ#7$pkU5U24 zzPLEwAb<VIp_uUE~+r5)jt(>>Bg48_{)twH$QJDSBrUS!j{lX z)SK$6dfLWt)c9%Cml+sRp*OHXB?e4hbYZQo!@=6 zBPTpi&6&atD*#Cn6f@5<>79Mq7o0^E!NH)bD26g}?@qg%*AYeE6Tec@F?y9Q8i}^s zz`)l`8>;h75!kL!`&*_hsX1%2)(lWr|7!}@gn%MfwY8vN0=pMm3WesCRv5e*5m4z|u(zbYCpuxO9$bY)hkL|}mRj{3dlRgNK)#PJp#vR=ka^TZ(tKVI<>M~ekIfd2 zm3UDUNW*ZvS5L|SF334|YD>LJk(EqgPpVxtzwclUNaH70zWDVt^1+cz|F?RdF4HHn z@4~Gs`lj!0dWi2n#>7C@B$Qf7|t{1!3mtrO1H7 zi{=I#^Oa1jJiFI!j>PualW+ncHJ)TelW$bv2MqUG1xK7R z%TsQfTn)7D3}XYU+{?Hq!I&fqi4>DmryMiO?!aN!T4fnwq2vsuB^s6fPW@u*h-JwG zNniJFR(RI*?5HV=tqO)lv}CRv_eNEBR%z}Vnftv0+DUH^OCODH#&;{+aw^1vR z-c~|Mk+o?j-^Z+rR4s z-gNA5guTuab7N`{Y@eT&)!xF8#AeetvQ6d!W4BlO;0#0TxS_( zMm-A-u+h7-PjmOQHlh{Hxn+J$jh?uEtc8RG8tu->og@ z86A%eUt+P8E3oLXIrq#K(nCF@L12>=DVT3ec6Vn=B^B;>D=O%op+0BT;T)FHZ`I93 z^5|bpJC_kB92`alM40Am>Yz5o1gxkIGRYQ)x^+R|TCK)r;Qyq6+~S9Uy9nr^nkvc- zxw~#_9eBBJcZNK0yFZxUK4h>u$8;4k-KpNTblRgS(y&u~u&J;O!aqAMYJp+(BED*d z^I#F7vPOEADj}Pziprs=a{%qgz#eso$j`At7pN~bDw%&ba-+4pI}T*?w-z^_~DfD~Z3Tg+#M#u{s&uRF^dr5RFZh7<|WNEG;P z-_SzXTbHc^yD$r;WJqqJkA7^(zN`nzQ5V16nG~Zobuy)a)(T@Ik>V!qOfw;e z)?AZXjzDJg%BkIEY&bm&BczLuWY~k}3Zyx#)jxg1A9R`sz!_dCb!|13b*3PiA@(E6 z9HmG2R>-YrW93UMQO}XE4loI(*er9J*wDUd1se!pzdpoB_v6^lQl}+!6e5MS`+bU#_b*a5Pkt;o+lOV4loyn2P z$3;z-cX>$R{6M4q%b}aMBF}6N+0RCE70bB;XwHV~JLO&!EB)Cgo9ta_>>Os1HNfaY z4PNu7BGhw`6}cm>glh6i^)Ja{rpLHix?C?u;(e&GI{?!E7$9hd*5c^iL?;6Kwn z@qbBE|3UMF|F$Ok>7YY?CeMzMes@CZJQ?&|R8v5M@XvW}jjxhjl`gzl;rvy6Nn9$K z;1TKGpUgZs`vR!t-sD~2ar{58-;2k`H(MIWr_cujtSCpjue(R z(a7R{q`G+;8qD8D1e?1zWv+pPFtk=k#>f`yqZo)3KwCBgABgQbq%hu4q}h+Bdyh?* z#Rlr*$38^Ru%m9FUTQL2Xy^j|f%*4H*{zWFRsMbs6@u{JM{48fq;F;QFV%6Dn!6X0 zEAr2G{RmY8;Jlmws#%7Hl_TvQMbLnN0KGK=9)1u=Vb&#V27UwM#U+)$hn#hlXxBxO zM~<3s(W;fe-0%mVWtZ)oN|h-01@5z=u(z!V>)I9-IepH|_q6NR_DA>2hxGKt-QX;H6(^FXwcBndi1s%qn2sH-rsuON7*ARP6Qt$2XIy3d#cn8sLh&7#USTFn3 zQm-o6-Bnofon2V;oq-v1@Ye@NuH$Z~+th}Cs>F7=H#=4PKLp%-!EwR&0`a}XL=br< zF>&?HNr}9ahB-EA7a({^_6`taBwmB~hJG)p>8r^vq0J_+o`sOq<{s2~2t}W&1f5`l zj;E0nmt?YRp{ONhti9{4&rvt5uoS0CO@%+Yv>+}ROQAGP3VLu^S4fe{ZRoGviEXMF zhM=I=Eg2~^5PIwEq{~Wt?inz13!axZU3knx_)Ey9<)z<=!TnCPHvs1l^spF`@INYQ zY|J1RWri-^D9mVY5Z{u+bXg#}3rUwSXX>&@PN+017W@!L5H8CvZf0wZxQ=UrHJ{Um z$Z;~3t6ARGql*O1^YY(h4awy!h_brE6&k9B&5l;ya>jDyW5?o$q~=1iV!t7#8&QOx6P zhQIm55sij*Ef-G_?k^$AjK2j?=QQ?^=r{MDaGZ7`Yo*Kp1uoZ=&5|O)D#xAHL)n9_l6-E!b zVV@8ny;`XU#X2((4cTmv5unmYzUmJ>Hm+Kvht&a+j3nr!sljTHUZn^0w@L|WKw2TO zRO>T!>jutIzNI5U_KL}vd00oi6$aJqPeJwq)lIr(2Gt#52i@sqCFaWC)pS$pYoRCK zd*$)r6FCClYp+n>gCqVF>x)ghAbl+h${~Mc_sQGk@+sR@b(88l zcx?*Usr}v|kV!RPfS%HK>Bn{7tdEV$CB5Z@=uy4>^(o(%@R|_7dq69s1(X_8szPZ! zSS~$LCX>-}F=io=YcY~9!vqo3&dh9_Mosio`zO6i|$&p;-9%+~sdYNrVE?Q8rS+eHx z4O$l|b3FUT#2jb(WU<`oKAjGQUsoCgE1(c>3byBNPhKeJ7f4S-hBRqRyePY)im;>H z)hyFuFTDqx*ZgXo$hn+u>TGs~=Bjqr3bhPmXG)v8){EU;N*58NKU5;EIZl z9%|JomX+b6M#jS2`B%~!+`EStMD{|y^P=`xPbD$o6;|!((h!+y%7Y{DuC!NCKDIN1 zER-J?vZ$2el4y~!-0vWjNRoC|ARB`IX@M&;?ZpULcAIu`zlH9 z&JK#H);Ij~fqoT{59}OI#ViA%!lPYyd@kHg*hyI;iMdCtw2&eLHOd1*N%2Y!BG*H_ zu@E?VbtZlI{7B{C>A^b3njh=KdF!=rQ!)oIjwkP{t^I{2q&emQ-C1&U&fPC_viACTbT;(A3qRJeGINz^!0N26vQ~o|#pmjp-Zq46%+{X9n zLGKqhLh4`-(*oDHqHU~-45_+pe(BICF$*0jD&FW?ED=vn=t?p9X(%AH9+;6NcJ8JF zASkf}LfT7Z3u*#i$ml`gKIS>3jrTla--x##EDM{w{>Iu9qV!x95ECU*W_O`q>hcCa zswU!;H3R{}(A6aQ(B)lImTF$BzF;$V_?It*+8ZeiZa|b8n_DN4jUfI0jIA6Q6*c0f(uq~DxrNm!$~G=Uz=qP*)?qc(}|7MQZT&B=Um zr{Lj_R7QJAlwD=CoYpjQsUyu1)C9p5CE)%3nb)~WtP;@6(qGG`*qDT zS(zM>&R<;Z23V|80%3s!`0QpTt0Ay;*xLJeE|DP5@x?a!1)`g= z-1}G_LxiiO(*?R*{(yH#&yl|Seyx6*+ETayQtv7Htk3WPvI;U!@h-e$)gw9>pyKmB zk8#$3BF-ou%=`9_3)Q`0ttk$cymvULFS`Khmjes=2(-QY@eVjJ)rSD)z)1No&o+dz zrGItPZ$QuD;Nqt~U{J?9VlM0g{kx!4$?!?=o?um>#7tjMzrLfv<@pI&cp*5H>XPPZ zu8Xh&6y7v0pGDiQqd-~tBjK%-SO8$8kG&44|{09|FO5BoNkV6~JX>g{b#NHJW?gmM# zhbcS|M9fDc44(seG%$hK#va#4YL98mddGDi2qr;@CeiWO!!`DrF<%=_^*3JgoZiSj zdEv30G5`7ex`XP4#6cG;AQ}(|>CcCTGiom^pc*j-Mz1_oGp4iP*>N125YeWCw#L4H z*>u2Ih8jVRJ?rOj-7KbU7KXpYs2UZf)Vf}(lsM(oiB>tgqX2tILJitw_x z&7gq;`b}qrL{lEA3DaXDOi~HQ!^?xxjjVW|#Z+Ek&GKA2dYgO@zB2V*eY zx>@D06X)(FUz3xz99V3v*k7x|wxiFxv>=N$1Chfp>CErJq)gnf=P!u-QKrYnulzdQ zP56u!AH2^QVnuxTJjcQtlflq>PSm4C!$^fv4V_XsIO2d=O8|J`4bUDtjBchJ!14~3 z#mgUPYF*Z?k;Y)Igdx3yQg8L)M=c%}p3!P-0KOuXI+{*LXJ&w)$gzxeTyr`)h-Nc! z`$xa<>T2pbuU0VR?#FPEM44XDRw+cM6U1R2aLQpGHX40=4Er=lp&2aN#P1IA3|r+L z?5jaRyCgN)b(KuS+(x9rPLLjY&4^YY{0T2Ai%`f0p}sG*R!}{DSf7GdPJ=C2MT1ND zUJ@#y06`CNc9n?13R2KY1K*SYeV87wG%bjcIbn+AR8*FS<{?wWomTT5@`}~z3bFAJ zLR-wmE$iwwJ-TnVEhl{{?+??DJ?DWk~VaX-L3-RLtprT2%z-GfD{UVBR~T}zymA0 z6VZ;1Qr%5q#+Oz#3)`D(%WVWWS4BW6%ZvAtt!u25FO@e{X`)_LH>p&pFzx(wvNEO- z!2$Z}`iynmY2j&UCmRNB)9Cn3MXRls&PFVHzkzr;)B^BCMY~6lYY>0rsKT zm4}RV`Q7tbn)Aseay%@-I6ZT~PBsO?D|>kG*%(PGo=|gZ#0zsmE})xxtAvaCe&$1? z(7GyH&^jm!cguuMo@CPA&-lrdE&Aq8GIOuUK9jt{K0ldcvJJp7I`ZMx-EYj$)hl~) zFM!U~HxgO+lb$1cIK-nvz<5OPs(@d4tB6DUa3?-bJ98|dv-kIdtMS;9BuLc{a~_wW zO$u`rNymsAeMH9zh(|w=<*V z&&B{&O0Am`<$iBa)>pNZ6cO`d^3B5%=gmsH(HYZw6!U(c@}#)19F}`BT+yOfamJY$ zYOmy2m^k+ADH2klhAJMLq;6>t3)NREUgk*cjJHg{NBkVhDORNK;v5362&NN=y*Ef- z$vxYTG5Ga{SI&C93^Gsu9G-osqbC9PbsC&@xxGlF?o{!rs9|YpEE?P8ix#yS`7JUy z%ez(_Q%I^RwPrW%rFF(+mE}rp#Wtg@^>O7T(@LFA7j{LNrL=XGDyB-|3<*mqLL_UA zUZz?ulF$5O59-WWZ!d@hRxC@4d6?okW%`1$#<5w9eh>4Cyr#xe5%VPG@TBe#HA^O} z1&q{T_TMTr($f<()ah%TXapiGp}`MAC7>0I=Cx*t+bXy+gMyk*#(A~ft=&4YBdQki zQ}I=c;etc@sD4?l`eYaksPtJnx5OUaZ6u;7p64DUuI`omrWjht5$8+cqb6Hw75WNX z@D(fl7tDl2H)H%QYyX3>cL0*DZPv8+ZgaP7+t_W}wr$(CZQHhO+qUig`^@>y%s1~j z6Y)pXii(P=SQS<4iS=aOnR(rqe#b*BR~GN+bMNQSnhcMHxhVf6D7_zYs}@oo$eK9sZig1_lH0|C z&<1W;8dh6lutS+|02t0VqRfh9R+%!~9YsQ>cw-uGi!YMSo?19?Sty(u{GRqmTx8Zv zLz|nph}CNn+4a~dDzMog(j+NForDvDjLwub!b;p@dLHSBO0kjaI0CPZ)8B2(HNL&A zdr8Pw@u(POF1J*groJ~!1|E(GmnR3L6`P*3C;v?R zDw-pBC=u%}<}P_);mn-_cE}am&b1_WlqnWVzFS;*NhwoOb%+#0nI|H*Bw6_0R(=Kj z;7@eEqYkW2OvWkoz|yY1gZAJw8=>KShthS*ANzYdDT61^AK)>0H%LV4q3}hw?bkA$ zF$tz;<5T59v0Zd$)unmJ{vu_7eGDP6+pe(H&n^3E)g^rB?pn?GT9l1gztAUpR*+Kvt=FE~M zq5rZM&9v>ww1mzrK)vx*0;;?tnqA@Q;FBC@$2~=gy#jW$bAJUNIl_YpT)``*9nnkV zF!&XBK8(PeQfnScH*JaYqy{1bN4MwF=&g2)`!Kuo165*d^1Sc_d{I4>6V=>74c%g4 zXE_M`b@syq%jQx9VRp@ba!rY|MRhr!S3bN!1RT}^I(2gXE`KT57Y;maGA&dHM#`4* zy%@6YB0A6Z^?fg!$4Gq0auM47(jE$Y4osH zhydBwQ-S~vMS7)hg;AC=MRf~AHZu|Ue*bk=ff`!Ol1%=|W-a+~l)QH04q^oeMZHj~ z8$8jQn(n1#O!_7sg1hi;{v%?nd&gK7tfN3I{A0j zcg`ISk^Ir4G=(SvV$v}DE(nE+%rgFkT%cu5VR0Qa^H4-xPC*7Y*+E8#xvyepS#xYE+FyIIi0|5$J%mKAB58%MgleT%Zx42e^L`TdA~Ips z=NvgHNpYZju?*J>oNcmd^(nFUc+-bu4*+9)qIwU^g?1_4-&-`uZm&f7F^1?@3IvJc{gnlh?no$E9jFIfJ8i+33;o-!b2hD@}}{o}J4{l{44v z3Cd{3Lj%9^E43SBXmIvwsA2_8sXgRu=4=H{j9R(fYcCzOXriTZ51l+HcXr@)^?rK* zmc89=w8MW+txdobBh`X4rMvY#vuv0GIEO67sgL}mIw$pNW6s8Fd=t z@58{pFs^Oz&g}CPr8EL~QyUjk&}1qyO4;-6m0MRd4J9T2r5_j+YdeKP%Q+jnWNdV| zUJLU&d%m|g&3B83R^8K^WM{0at+=9UdVAzTnL+CqdcT#($38|-fQ|BJbHY4vk=ANj zvX?ek_oYp6t8bQz-T){|-5OGrv`IGd?>X*h(s{MvQ{j>fZbx<^-)&(j8(N+z^sftB z;V$0+Wd0oUR^&)Q+2bHfLt#V~jZT$UPUbkd#vD#zZJ&huG+-;T%sU~ONA?a`Va|T%I0yd%0*Xr3>p#slVg7Y<6o&Bx856S zg;7Q>mCFF?xq_m}VG5`(0fIX(V=yvQ;xjpwNhrLFMui8xdBw2aFOvI3t6-NG3%+d= z>1un%A{1+tFrn2nu2%`-hiqYhXDga3%{ZVkC@ROtTcA;g*E@K4i_G1&^P#Pl_9*m& zwBVKqZhrf4bhw@M)78cm zBMB!;A)H{6h6AjEv&|DGxYRmY|e_ARf_dMIvm*-i4hR#IU_#A_QYP@L|sHs zo@Ky_Bx6e2??_k;7vjibD#pM*T7`h9V&s(moOn_x^N|9{gkOtFY~gDqSo+7meUjBR zK2jiOsA%PwD|1*KC^m(-WZ5j2AWi;81kCi5t)KouHKt|R6m{m!!n|4YN3yyBo0mSZ zN^yj9>I9Y6dI&$!T7&$%3Ccxua0-&DoNJFbCV%1;h^-U&1Q+@47qrKld+QNGOrh{a z27PfD|L06XuL1+ZMc{_7rB7bd&WD%*lbypj>|K|<#2#t+qPXH zTm`5QC)ktLW5+G&4lhvX8DgOK)|mvQ_b^HuJ&=wP%Z6%;E+Bx|#|Q}vOoGR(jK}sD zk9x4A-V%Hs#G>J5XldT-W&|Kv(!mEi;J38jdK>L|Q7~<_no&|~Fdc~yhC~%VqQc2e z2|pva(YaxgaE`xa5=u=WkhtI|f`XRHhA6|>1`)hDgYzt9kByS$l*OQ2O-a#Iq%SLz zV^&-mn{^KrM6&BueyiV}>&)9rr)de2+DkV8##PSmko(<`nqPVr^n_V~UoIi`_yVdB zzcj4`b5QijKNrR%0AYi<`{NDb!y1^#Pv|K2N8<&wlO7-JDa5Yp?eM)pf>PbMq@)Wr zvki0Y1yLr2WfDb`RBPgq^VC(KH;ofR#9^i$TaMi9J6p5TP5F8<&ofnvL|`*(;urRO z?0k?7WiOd&^v);ux~R9Hznc3moOxE+O$lYV0Ku|hENFV~?Lt!QZlMNp1%d#^Rv!pC zfq`*V)n<`Io8N2XGBOjLYB}#{g#>o-?Hmb6$VyvSN@nI?3{y-pdNvcYe%&%CIeh?s zWfdM@$o~R)P|M>ElHW0BAMI=ozdH-Fle#Dvq-bpmPg-!rDY|1*o|1dvDh9{`{gt%n zFemDyrWMrywXJ+rV5r%UR~0T*75`i&rM4=%7}ulJyHu{rZw;C$r+nn@cLyLgh0d-A z(3SS5tW>ZK0in8bOH$vW>HIcipgUXYGUq49#>Ixff27cCfWz$0vR4Dmq}CBw<~4Sh zDe9adM$vVItE_)3FJT5Bgk}V=1g+Qvf5+hpxwh78gHe$<|r1^Nh?B&_~xSq+nVdY+~dc4GJ?e5EpV zXs-H~6poV`Kh5kok2qSUMD?0&WXKs7T0?Z-J8zti^WD-*_fo zhAqM(p+l2*(|b>aZC+?aK~^_VCZkP0>}TxdEC-KcmAx*YS?wTK?cW>PjS+NxM==Wg zg}e_*NcH%2(J=+WVL+;P)kz0c@48^4ZuemowCO=rriJFSD|#7D2oO{}$kCbL0#0%2 zQe&D2wwJ3%d|+L`bE=&9k_~(BOe$ZFap$YMGL$&$D0=mJ9n%He#RRlC3f=|WyrI0L zA_qS=kzzw8f_QiJYg_b?xA6UgBS0tT_Y$!9>(J-Q|m=O+8+wIPlb5i=-aU~kBf=4dD zd6Q8*EoKqRCcMNO5q%nez-osz1XT6PZ+r7r7A_{!vpDIfE$$yCUU66H>HOUO>u7aE zs*>|KS24COy<^3O^xXssCI`2iF%;A&7{j1UDk9dvv< zsUbj2HMoFr%{j!bRrmyt%jM|4UKza#}%Vf*_fEvi$*6J-h}oRdsdinr_W1-)p24zB*p9tfDdUa27+yi5W`#8+~eE_NyvNZgCP48jF8P; zgYS#IP!@sLe^SeCy4jwre}sC*A4Vk3|EzFISR4QEai+j{bL%-B#Nlt4WJN3eh+Uo) zVtaBF&A%PtbaaH`A~$h0I(5#|WARn>4Hbxy+Jn-$LdJWL+&({?oGdxCC?@gw`D44O zZ)fV$Yi@4u-zGU|!cfh6Eq?2C3Nn%TL2ZoA1+5g5O#q6$QGS|1C!;H{)PU?dDlSGU zLGKxOa;zm!C-Zghet4U7l(%LaEQnKF+>ECNt@`F07q-JO?%%X~*k}Yndc#f*iq0`hgW#iOvymYI0Ur}T;8qZ+%f1paM#v7e! zUS~+CMQqEbYZ%Ix+4iKAGa>>DLya7d_5zQo_zm&bP6F_75Qk^L7A%?p74r#_+3V6R z@m)%h$SZlQi)PpLLYyya^FulLkrPuM%+!YnWBCX|f#M*ph-`6S5IH3F;Os;ZZ&cDq z<~WF?be7SQre3OHq63A%t27ee4>e--Q*N)lFkAI_P@Yoq?Bd0s)IIqLY)xtXU`k>x zfQK0;b2n0v{oPhQju4$`uD>)Syw=X_l}YEfVF8)awhULL-sJNdq;z8~(wyAEW&sDx zxqHk8ufaTXHNnIUP~eE&k>D!g#IVt73wHY+ugJwtuy74u* z1qC32jRV4EWbz*0B5d5qGm7FB;V0Z>C63g4n6hW?!BfHU=hqZbuGx&ccdij#|lWok>4#{m^Fy>{`JdOS zjIM(Tuf4sYrJltP%2vW!U)Mt5hd5_vs^{onYW=T{?nF6taSUF>uPLMY@>8Y#vd&fU zJg$MqI>EOkIj}Gpu%?+k{%zvX7zqvMeuMm%YD6eLoHxL?e6eW>J~|~Z&lHB^r_Ag0 z{*SlMeG(r}i;4UY6e1TDhAnY@tyh=*e7>7?vlwq>&py69o*=hIE389P!iE)Fe1v;HN5fVGS&&jBzQk*Q}Rb%{FF5H zt;vL@*J)TU^_AGy%>+&9)+R@9XQHe9%Cr#w>Q$NM0~WAiktZl>9`I-Ypc0UjVU1rn z_FPNg@88w2iz;NHBJ8)vM$%1oe7QzSs;NxSieG5h->Cq6`M#YqU;tx=1hYym@h%fi zzWLOcEgsbZ>jW|mkR)qpxv-Z}J6iTzy?L3sZiv!nbZ3a;A~Hu3j6-^%FcrouBW^*9 zwOO;eD$2J8edza=ZDF&}5X#=B9O(;A4zyM&5yTvxuoqjP+FZY!ZYI`_D=;czTJF-e z1-$=(BE%9~*+c%p5UT&+n27&>tc8D77L`o(F_e)w^~KRuv4^AdNE-D~2I(p(SCPRP zc{V^gm}JdYd(~~{max0nhdPp5j3){eJ z$LuzR9V>9)451K&?27Aps3vsd_bU(1EDOA~g;@vOO2Ty`4MFO9u=`!_wEKPQp>9L& zzuUbCBGHhsuxYBy-^Uw`)=n5pSF5)!a6qfH$^u&=0GA(}B-Ixjj|ce?Bp(~$q^7BqWU|H8 zKU!?5P@+8*_63=^7)|h<=`vW)2%PZF(`Q0Lr0x5QLjWKIQZB9)OOB_ISy!Mx`E{lJ z1=1d&Ic*{{_h#6sNH^Hz)~vB7gCTbuUkVrOm(pCye57-0NUsKiFMeA#@NBB+F5<+s{(H7mQAPQx`OR z8xRz&uf&f&-?8paW&Q%EHCq$Lv~}lCIW%s>Wxj&$Majn9D~*{Yn8jBZ3b9-fuz!82Hn?&ZI2_JZYAy$kb_?7m*?J z7EcrbL2*)gJ(Wl`yg~c)vC1w>dR$LezB90-T0%EZo|KuQOirNpKJAd) zr+w2F#9m@j64vevMEx_$M}ESx!oajKsI7|Q#c-fWRsS7nAgMlxf$l`eoBx6_u1LP` z5wVEEAYNPN*iXKJza7=aP+z_r$z;5})SQGWl0SrU7qL5T>MpzjZPVq~an6pv29s{gIn1Rh z$*Vp>0p=05JN|HRiyOCbpgpZ@;9Xj|o3DNV!%Xn6t3hE>(=2$dFuEx{osGXYv`m73 z@j>86*-gsSS^3mR)HB6Bj1fy+E{@9e{bcRLU_iAqDzdQUqG)+sqNE`h1 z$3w4loJ+!{F4NdK!E7Vu6L}j5d=VnffP!j5b(b5(u}{;?o9PB`YLsrEsOeE8IUM8F zj!}~kYF^$l^i7CS$AnS+a4#EnWySE!?hNnzWe>=ETyc4WCXpNzZ9R&vLWR9n2)aFS zeT`FE>ZzLpjPr*qdk%A3<`U8cpr3K~?abpqM})l-j}Hz+9tJcw;_-BzCtzpYoNVk^ zd4xI@9~_|+Y_6S*Kx+?A$c)OqC718Wiat0Sl%qFMhix0?j{gw1XO9$zQhjjoeDj|S z8hS*$R7Ol=9=Sd-9s*OgZAC1sMC*(iexn}3CMYJdNZu8^S5)5@Bxo7ayS4fG2D@ns z(Y9t_4DB(20CAx~=eL=RM?RRc4|4V{?Qe z=>g3K7H^2nxwHm|*N+zhk9ET-=0ak5wZAxM<)DFY7|^q+@a_=>AXMj@vZG11mH%nQ zn9XfRt7)!V&u0~v+`DaED;5~WX_cQ6~@iQ$)`#bKdk&+uvYtZMGQ??&zRmpw zbc5donS&q;jPQE_7rh5{ONJKBM;cxKH>r!f)K=VDf}bfc1B4Nv3C}__D{B|kU4Q04E((6!W^q+&Xb=m`c#S!$wEEp4py_0 zDJO?v%A16hzF;#-Lt+DUyec?VXUS?%21=wBiJ<}TTQMa&n$+5wnHr4sni_Hb`tFO; z((Kg?Xh0p)JZnUc=-mE(Ls`z5)+Qr8;F0R92sj9yEJx1kK&wQ8S2S`)h+Qk?^jShBw0n z^g^Pht7xCZvs&|5W95{bypf4acXhX`O_>*QyEk183j48^Ws>JcasVrhs5G9;&2dyi z%>jCf;J1W^x5i(=Cvt|^PAWSdNG}XTJ@;UD+R!_#xn5!VD8@`C$I>Ipes@q*x>0`l z)z8=i*VF~+bxTYjaCr)lzaDau^|9V&q!IlGwQu0TKbn4oBljDL$D`d(xUR1D_M2H5 z_D)E{)YMOgPe9j&Ta=X`w!K8L8Fz1tOon!uWan9)huounS4Mh4dF)BRXPW~rZ){=b z8GKrX8h<5U_7;gkNu2?Vha=mHR?g_-tDJ7e(~;kBqw^DncZb0-heR1$Eu84i7(X`&aR*AQIwovW z>fz)N@L0uBeI%!;>fF*(y?aB?LspSl*h;#V3|hH@lSBCC>z%=##r4vBD?~% zIcaMD#Ep&MMR|QloYSVm4m`6&D~o=K)KUR!2dn`e7}AFYi4ni=M| zwlXp`cKoTc{O?pVGTu@effshzIQL;~Uran3$O8b$6lS*o0sT!BoyZd(zz&P7axA%@Nz)_qI zkD$LWxQoOtM=CJA^aux0eMxT|$TTV{XcUf%R6YWWWpb~~Wr+7tk~!$o(-O!M!{#H? z)jCw2taNz0WO)=*Gud3!7Hi9?DqB;9JQ_pLDASj_PC!c^M|om%q>Zz+S3oK5Y^V&l+!?6vHO@6@c? z%)vqVE`pRD|ItbFC1kt4ApdNC)&9im8NW=RUr>

    @up^y4&I8N>~wvL%f(S2W%NN zf&x46sN${5Gh+I9cd>g-O|x3@x#@hdvU54zx*WtnC#5%quWk43w{;_G!4&;N;wy-O z?urjbDnKfp2u4gknf&*wBJS`YfdzBa#pf^Lo9ei}Z)MCk6MP}h0OYrd8`jVipqsRTq}lh>h#|o4yiA zbPQLKXatZ+L=I$?XEGfd7x*_lf|=3xKLi)yj}jQ9pD+OPrv;Mqe+~uywe$sD4D}uV z4@_J6*&E>)?K_L=^f9)ZpbIb0tyI>qF^OuZ;8LrA_T9JRowWUXNjyBVFxj7 zcFv)I!ZI!9%3&ro1=#}qZ!W@`!*%Do@xlC)>lS-KJPYY3@3mXj^ZUgyXXo8DiZ)0M z@ORv8NQ5xIiv%yy7WuvM3l7ZnaX8M-u4s`LZ2-*e2V%BIin4U@4b=3ps|#~L^v#DXv3GDk8H#;lK%qAV<%I5Z8dd3-sIMfqq2WY52;$Y7| zC@8Z_G%EJ3tOhCq_Ad3l4=IN9=Ee$7k#R%^@JPd7SnqL~*a3EWdfPj^Ft)B}bgnkr zBT1I)!g2ha@JU#wQW1op@1SkuaGVJcEJVhstebVvoHV+n`EI?;^p~M~tfk#K1CBi- zF<+3FQvDXkoVE)E6Bj9T)Vlo9rjgCj>S}EH&DnJgn49L@7ZaI=v&F?OY*>NLOQ-u43cR-0P{LGZCyKsW{^hNC8iDiqJ{~) zNqU!S?7Gb=jXSc_T>xTosLbq!#)VKVs^hKlReb|!_v(O0B(=A8tA0Fic+K)>Lc!(J zge-eb*cuWjJCE_q)D}kLQ`X73XAD=didg`EDAk|uw*rjJ1Yj*bj<;`v&pOnps=(g<^CaeJRd*q!NQ`O zTAcA*KCphxtD>M<0l)OpWo@|W=Vs)XFpM7C;96VQR+W3~AXoqC9@yN@7J9kuboR-H zHL8|U?V*D#Jg&`hR95a1#ByH}mfw|kcIP#b2%C}r_nxhIoWdo%k*DB;N)%#~P458H zR&1-?mh?}HxGi(-dh@nkK_H45IB{y)%qwup^p85vZeUpqh|G;9wr%q$_*4*|PS(bw z3$<2M;y;*(WAtHSM--PRyA1<)1Xe^(yuRRaZX9nR0oP5%Wg)P(ak|_q$^7Cd)NP#f zFt*;;hP)je2EkvO_Juc*@6Fd}(xbH@+`c?h1(9yjJzcLY^!{hs3;2?q^IfrF`+D{7 zeAjrrb~tUbxms|met4=I%jCVN6O3DEeY8_%NiNb1EvTu>AI1J!n@36jd$2##c}B>0 z4L;|^v$`6=K#^tk;MTA+ji{smQT)gaODj-((|WI%X2JbpJ46#0RZ&FMJeh+Z<&>04 z)cI;7Dm)CZ1Q9H0Ge@zDXKAsB9dZbg4?1joh3}_)K2k;c^(s6)kl-$}hLll_T0$(y z-4SgpruNv#}%R(l@3!%tj5l!d~Np>{BXo}gF5QWAP7*n?JW-N~>|I~-Sokci&_Ho87f;meu+(2@Yz45X{^W92m`3_^%9FadE5^cGO72ffn`$&G} zGOIPIF?FsLh^0eater8)<@~LjNIyP(W7F~ackhd7ase+Gfo@-RBG6$Q+CeDbE-eiO! z66k;0^Ze3P9kEj(yiZ!_vx)K5>+Jrl2af_iKMbiG*Z6y})9{?`w@LyvBpEEC99HEm z94J&4%248p>c%Nb+Y?Mm9%w8P;5(?F8nINf&_*-><^LeQ6{hj_UPeUhLmtxd+Vmgt zX+WF*G|x;d1!gF0D5?$*b6|tDV#m<_?(f{b+Jd?J92?)y8t>gZ+-KQ+Bj*PJW__xR zdf03Su)GBsi{L~F7m?zTiiu`Wk!YO=QO{H#)PP2?loJ6bfRs0oKxO3+aYm9`#}5V$ z`x646$5C08JvW-c>mV&jy+a+V^zH9IQ#Inj?BmB?I0~jhx7qLD!cSQ9{<) zCB(xvh>|7z&?P1A6fTeZ=vH4`HaRJenyQMrBMl$uNuOX#!uWTr0YsU$pvq9H4wY>t zl^X-E=|ppy073iT6Xv?zU&~*SOz)S{s$uTKR(W@_aAsUm!9UD9D`~`uK!3`Buc{%2B4{J%ioRlMx&#kB{e!Avb zJrlj#<)~p=4r6CfO9_3Cn1xhg=x7nk+LY}yn%fvBEBY;q4p`CSxj7WfX^CU5+@tJWJi(W&KcO*jj5x;xDLZ*AxFvIAYA@P8yW`o)9#pos(U zSgS*I-N9vd=^11lccI*yNQxzMgJ!_I?64MNHZL9-U_DIfm>8g{k^fj)WeFHM8I_z& zZ3l@3<|n0jQSo~R0*Qcqvf~?+vNohOl*bzy=)XeN;2a3p1~0V$$gAWoVuI=*iPkyO z;E~luur&+0{@(mshrT+g9pcf!^T48w$vch$Nigsv6ylw&q=E-ICa#nDgi$8vmBC($ z=yLuLM0U-^2^S`{_ZwTz$|kB|ZzUr`AM@J;{X1nZJEj`$4skl+fss?6#-GZt`JdU# zvVUW}%8!tF0rBe>`+r}#|FsnVkBs^MUX+ze>dHSpWnWVCqdl~T@Zci3NHq%q1q0&Z zjiRz*rIA75MSd&j>=Hq=uts|mK)cc}S884FYT9`Ym2Gbq-?zNU&7M-!u<)j1^s21K z7oJaB$L#M;cjw#E-oI~{yJTr2o((;6binRCTJm*%J0nrPf%?1jgigQI5bI~2dsFN451~NyCYYvfVfu5!YwE`!Uv%`& zB-2spw{|p}vcNP<;@k3}sV|3_r|H|Z4JC9~&KtI*)@JhM?U=mg#m3PjRVoE+M zVYM5uWSO==K5bE81EEz2?F$jdRB^ec45FWK&Dz+e}E=Op=h#{z^;qey2Dx+2Q2qzwA-MpAB% z6U&685w0+}tjouEmcVXOF$U)7w=8u*B7piVzASTr-X|xfrQR1uvc@IZr$CD4MUVF| zMre!R*v|cBT}rB>9#r~c4@(}lBCp$9)X`O$7f_9s)8|{>$Da!Go_qr=;4rtnr7TgXUpffMV9akHEvEw*Z&g!2Env6(!b;)$Zkq!j9UGy>Zopi zUQ<$5Ex<;BxM?&1+E#8>B$er2c?TqH!q^=LX)1lV=@=!xtMbm`$gt70@|} z8AM$V_n1o@=*E15EncO@{DFc)hEBSA@Nbk=GkNsF#}_mBtmF20k$-)eOP+G`q*EAP^>>5d@ea zg6^gb37{ol+=uYC3->5=jbqd}&J|19Oh}yYviQ}E@&>94`r85c>mo=XKA{q~2C*8q z1(8IqD#!fuWdW8DT^RfX)ssdyOzHq^sC=mmY``qcE8^g-o852h1`FBL)_0fHqqzW%Y(brO+X5H!1sl*7|2>*^XZQ^Um1qp- zj{+=uY~SxwTj1)2rmt7luK=kSptJDqqF#W3sech+R{=RBs5U1mcd@_EU~~8?dsmUjsf7tKBg%yZYVwFEDFu zWWQwnb~$%v)IaYXT;h~afPZz{4^@br zn($GS68Obz0BZLqKb0MyvEEp-F z%XZOu9nt29ll>hIY!o7Ulpi znv6Q&d-;x1Q#smNV37IAjmqJ`f>4;j)zs}@5Ggb8NHQ&r9}YcFk1=s0qSmfDIT zL}IzQfY+Hb7z3YWw>3^;vPtIw+@lL;+6f0j=R`K1?Rs$3&Ft1)@NM5zV1L&`Vbl&7 zswRx&Edg?U7fqYMBpWQ6jO&vI*KI5odc0(9&B?LUS$lNhs$&T-QLab-p|8suK`a9N zU;>Q)dneC-M2!FT|4RScQqNRUcScY|-Hb2FWK7ixX)w*zIKVgM!)R>CsoYSb9@Lsy zLJk9)H;@1=N~KM;fxCA80PT1w>bSwB_El6JKa7XzdPVs_qfTy_HegHLC>RgUxX-lj zs_$O^k~(_!_WADl_zRBtc0-mj? zs$_XlVRk8UA;TzI%p`NZo^_F0EiGU(u~@&bF!!jgly!a1es#9LBez7Usio}j;#J*M zYwchj{qF*wFL`?T^AP-=5n(>kT+$T_0iGHp4PM3Z+@Rs&k(ghDz;|7e>IBW%Q&>Q* z*|!8m`k0#8(2SfZzjS1JdAS)iL*a3Q>Tt-uHB0^>6;1Ac&)lXvA#A+^~TF&^<-Px{Arzw?$8;b z6(xcC)ary#!{#M(-LV!}WvwJ94Y}p+dl+)^9$xeZPD9+g#b-y4E)=6{dZvMSy(4bs zQqd@m1o^6YxMp0{hxGGmxj9Cv;|d+QcXE|*vQbI!0Pil2SOuAXlwDZl!rN-01kujv z`f06S5M~gsjn6G_ql(Z9v;Hz>hvm)t+G*Reo}Oz2DoZC~IJYFxV3=*1bcDI#V-ehb z`yS4?O;M_uUKUWRm9-0*%jA%+L}L(ouJ)NW*6>k4H0cLNq(fNgHv4Jnoecj0zTR!} zd#20Z0rVivt#5;(=aRdjZc}W37m&` zO8hf+O$5W$AK*8A8`$z*=vRHy=*QmoFlAg=(s#RhNTHVYC1}1K@hC|GVLZ=F6-*0x z{+sO$vPen^=y*Dt6A!PzJ!}(6LIqT()R5jys9m(YH-ka(Nn?~~Rtl-H*pP{zU-MQ? zlXus*&2qLymA^@KO>Y@ZjhbR)e1(|kVQ~2STn}zH$Hv*3wWt5KBjg$eN#@{G$fcMS8-`5K^IA7m_aM6 z`$)$n`bVh3x<&!)d?X1WLQ9uG9!?;qPGiS*BaH;RE}RifZm9eNEHWtim)l0DD^SyZww8iac z7r6e^#bzT+IQYWSF&Kq!LAalh*r_;Wzi*>jtu~LuXq%d^sr49_?y34lr!u2w+EXxL ztvGKYoa^y*IC%Ypz%YnJV8{reNW^fpBHc9m`O*l>0iqm+au0Ze=X^~VrnQF?&PU+5 zvDnPzI3)KOpigkw6k+Ys(1~ggta{l}hmoJQoMZf-VJ+IOf#vtk(!25;+d@FGwm{aR zAx2bT?D_&PU}I*Rt}$?_UtrnE;npz+3Wm#cQDminaPZX-ZsD&rZgNMlOP>~lPs)5- z1VY9g@uu8tU)@>Vy33Lo9Nkp)j+fdu6g^!Frwn87+^Rz~KEqIZNvGPU)wR*jLB$B}I$TO*f~!7t4654oLO6t8V2r?1+T_Q&0K0 z4682u*_{u6j(?P@{;`Y5=-T~Y%Kr<77Z}0&gZ+aQ{5EN9gm5}+3o-ZC$|VI0^CJnl zlu@4piaXoYaQOv8RMg_I3w0k1bN&6lEJ=n~1W@$^LZ*+5?6;J{!0RU%BNqm{<~-t- zYBiVcsKMtWrxI-wsbMy>B;oLhCnBi?O$~EZ4$9!UcL&30S4}6G<>y$P0t(I%#Lna} zX_$_w@IIB}3veH9GP|^0P;_>@eR7vav@g)kd8j3{^_~v_K#JRObGNy!PKV z%zyngxUd z^s@D@xs>D?9|0^XQSe9+5fMBr9-1rL2ipylxZmKI{+KWoVU3B__h9-y+tCNq0iyqW8C?N<_=wTWv36hc-;u6_5$-8<-iG^wVX{rs#%*o<0 zP`zZD%9FKz8kA)Pi`QrR2c(!`3^|x4*s*D2BB*E3p1pCB6wSJ(K~r=?GY2zKWbkSM zk97>~}>cv zb$Jz&BN$J`J1%`SPSlD!*ydwZh|}u@DspA$4$sz zuve=&^SCLUwSd_bGS|G?7q|}mlM8;PN?3s*Qn`LoL_I|_0v+g4G5lm(&>D&~sR6?l znI)Ws=bL^}57Jk}tm&JypgNPrn=57ljDoPx5vC%_rIdlHBI-9tCQd3ccs7 z8t-*ywH72aUrR7)OSDPqV2JeQ%}`Fj)8^<7+S({A|0d~}AU_#mFK*xIuPXctHbR_6 z0>4#tdv;L;zy3>@ngEyuC~{UEld$Xby%R!P6GeG0aQ`p@>*JR7p_5+YHPKN^V4fk3 zP=|o0bY4goP@xf7HieU5*Pudrp}QZK@B~{n6cMl7DMdWz@t^;~@D^eU<>!6(45Z(_ zk$+hp^uOOo|9MRR!MG0pHBKn;ANR0%BC@7!gZmJPZJXt>$m&mX8a!}cI&=T z^1$X1PVvlD`DVXD#eo%T9Hq`v^hcCB+%v=fj3To3%ZWn%=JZC_ zoex%j4J+ zbQX)n1VtYQf2U6; zl+lO7)ctA65@v(JWy3f!Jhj+syx9tcQ)P2qi3?*W-Zw#Ork|#Fs{k`fVV_!Mn!xL3 zIk}JIQwGd7Ve?#cLD_l3;B&IP`k1Ad;eT4RS=pW5A1i9B3J!lo3 z!WN4Denb)1o>9tu9*MQeIgR3$ z0rD%TiSRC-!526-Q_<1bGYn58#9j%95VT-muFHVK2w+EN#G8i;i`sA@UJgGpB~}7x zXT$xV`dKsMX!X;9Ku-Kvd`_&(SCYV;p<-2TVNbPS!mBJ-Wd&_+BDCO7!-ztt23Z4X=cs@kswD@}xU^1g^h~pu=^6pW ze8CszeDle6mmn7p6^EWdfD|dyNB$Hf%@?7eA4}|ajD2dyBKnD5ou30#)271<>qDF}GnvD)t$ z2fj&M*=&%VGF>YIAwtb!y?Ie|YWR?x(XuT5a+5#3i=W?qc_A~KjWxnJccu=Xz$PiiuHzL7#&Jt#VEx6v~-8J%V@+^q|MYi z{c+eNd4k(vCCT3b1G%D0UknFNZ?%lsqRm{_Bk#15n|;|H)9O&HOroVE-FG(hc4&ZE z(2P$V`Y^c7#KE)tx3Id<0tT%cp7~`AFs#cqf_JH!mS_Fm3^W1T!JXma96S=IrQy{} zb0%%7OB-G)J8g)5WpUWTd10Kg^gMRt${vh%)nB};`vmNAbL>TCRA6}wIE<1qWykbg zPcCUTMV-!d>owCDM3^BD{hCpJcQE*pH$gV#ErC;Wx|Pm9SnipSi4GEzX%cltZ8sf0 z4GJEGTyuxoh}YL_^g{rSCj(Mn9xB&ZpEqiyz-a5H?)=3b8E8s zNV4xhy4dT&cqJb_1$w&<_Ly*)afAyxX!#R8gU)gG)(#SXrbXZnoP4uq5;X(XFv+a6 zX>3lBn@9^3=&!a@Iy7C*kVuccxvO@qV6GM z%IEWSgV;mL3SA>lp*KOzvB5IVgDpwgX_;?gI5YK6==zNjtGgy=}3pI7Ml z*K=k&-d*&zJ{n?u+*PW8qBhLLy>UlMZiEIK|oHw$2rs9WFwD^(_d8L4@aT5=s?a8c%PT*VUVg&tO4QDy2SY zjm2bF%vg0dwTFqL)$eqaDox6HxHo5b zNFgp5r*h$E+lpT*h%KuH+&3V2#-tv2SyzkL$JGiwZeF>fbV(hQ2BwSr_!rt3?1T{# z3+p)Tl>z*Z!>MQQ>u0C#>Grq9WuFghUm2<38IZ<^qz{5X#CQaF zf*+9#(YJ9s#v$mL$-q)RasrGY`j8?J&3!QZLlA<|;QEREfPSG;1T6Zobq2^_0kt5q z09VRDG;Z8JCf6j{ENFc;@3BBW=)L0zw=Nv`9rTWlU%SG*pCtHSWjNhK_eeShOUWc1 zguBW=S8?nd=TBUyH^szUGwHcZ_085TFwz#|m8>-DLDz_i63t}Q{&1Hz4#&BBM00Rg zVBLmTo3$&AFIBXyzJFV$-LXKdTj9!w1s4u$sTtwJ%L#eIW7Q-qMV*+xeM-%y0(?Xu zYf$T);aSqS%JCFk#=-}_oMlbLI6SL(vsS@VW3P{axttW?Aj^|nTNjt{WwB<@*PDZT z83dbE=PjR;JkTlb_0}gc$vw%DL8IuHL48?t7bk-p_2$2S%@_`iYL2H6r(tbXtG6$H zi1#UpOr)gY$kAjz^D_2qA(d?Drx*fE7ciOz|S65GQ?@VtM-pB2z zI4+D&hV8ICIAo>$0u9M+c}S*w#r~(Y`X!*Ot*s<>_$|Jy`Jtq%-UyXuOq-?62R=8(;>I?z9KdCKML;#{YLY$;T>XZm?=UMn_|2rJTDP1Hb8tg|jxd^v+7b=!NmtTqBeh&ZS#8&>3NHz5w>{Y4R_ zO^gPq`R-cbRMDwPNbP_#R>)zaj_`d(XF|e#kUT~iLdsnipk{POw`}Y61ZAD0nZ%DK z`9$<-)~~Drk;!X=k_bh1nq3~u>-~rbzMYZ?_?z4aK6~P}R|Rp=V)u!VrbLFxIW+2b z>QCbRY0tN4TkELh&c0Z?EZk3qPr_Z~pM`RmqbUOkJ-FMoK2VOdHC4y-G}8eV+DZWk zX6jN-&=s0$n)ykYm32Cz^-9AHW)kRCfBXP_Rx{TG3mN7#g=+BS3*~Hwshl1}_t0Tr z@>%){i8cncHw7ld83d}Tbd$lY)kp&6w=djR4OnT|iOe!>@!}5DO!8*$5^bG9=g)2C zhntFe*FYJuTv6y}J@zbU^Oo(_A470wLp;z+iI}Hu+#FvD9GC*|JoXx#vUsEWFMWzs zrZu`29dr4^OWAsvC}BUpF4b3865d`bCI=`twM+)7OHA!s+~FKJo5g*Z3)bGBekB6l z{^OH$w2KEi*_gGoh!}k-;;t>d zONzdN&YtPqo8~CDbOb*JqmAK3!_<^zKpEMCm1_Aw;5Ap z5mLu5wB~x0{)K=s#@QHe4QB^QHDEk8EK5WS~XtNf1f;f+>NG|?7@i{z{;oEixJ8NF5> zqrFoEMY^>gJf2r0h7)7!AZa0;Q)Gm-_udiHd6-r+nLkdP8Idjb7YZHg0a|P*pi7*?SHZmWTU_)ek9rzu5jNMxZ1-PQ*8;dpg0KMZ+ zvg<$xcKwT1PCU?+SNM$wAHJ2tf2-A$Hg|CNMu7i3u;2Rm|Lb+l{H9sv<-UiSxL|KC zp<+^oL`w;+0@uOD5|ltr1!It<>CyM9qAyLPU7^`<<=sZwJj}lcAO#Jed;j1|xZP-) z_$diC9(R?o{+&~-z0B_J_6ANFjEe%X=ZqU66Q?A1(h!AWTU?EZ3$shuPcfd!pqaK8 z!fD0;=)T-Z(rPPKxoI++8v5w=@#2 zMjXbSXl5Z|#_JGO8fUn|tFn|N+D7@TQwqfCT14gR8eKfo(XD8)29;&w))lNX3C4^C z4_yvO`*Vokel4~CYWw|m?mdP`6}1AN$VtBqzG;7rd!*;vK*TA97s|PqHCZ{xFnm)~ z9s2x4@urFRS56_BvH!qM3*$k#n1pR|IB6|zmWY+93=<3xqmsN1=9s}qAI$)aN{!JH zA_;b-#~mdM`1_d@qW?<#VVuI_28>DS-W;HRhS3j+m07d#0Xp|#ZnIhhr8t)5s_EE` zT3JNF4UnQUH9EOWEO^G^5&wflY#veqIXg;kE-My3<3l<9gfNQkP1q**CvbxQNd9i4 z?}rC`rg%nf{cI18sklEK1$F*5M?}!fAVS$8bbE-G#XWNyeA8y{>>3X2v0d-+Oj2Nm zDM~hDkKQMEUONW4)V08yH^lSkurW|St2O-qg*X|7z@2eK@Q#PRzc^?S&VF!iHkZ9r zQ|_p96s8ueJgP3de8T?u*X4X7*PB1c+u43Z4}DJ|zhVoT0A8Fiv)KyX%2cjV8ZN3c ztL25YZ~Q;dWu@}E_5AmW*7O3qy%ypGR;@9T0t)F($+h1UowgLH!l=2w zK!qu7u!lkB2db9ff@F80U3Y&HLxo6uuR{t-k=~4>KaMap`91+%-=X4x zPIjb`(iwV6mt`gQh|&>5t)M7K(0ED|DJt@k5JMGy`CcbL;4X9eMpYv9y3t4yjy&B0 zXf?}(|7;DEY^&|$+8O=?lHh`ed24Gb-U*!6TTaZ0@pw}Q7YzJ;?~UHyTPQ)J#Zvh? z@zWJEmhvLkp>o(em;{^vHcBnExu;CTR9eB;(I!)lr!hG6E{)ZFyun7Nb=JW@0qs@d zEkQlh4xOnd+KSSjO@HD@I=o=|<+>iix{rdun$Lsk$f(=9m_IWJCWN&~H&6?b*q;D~ z_z1*N#2($~+O|WY^B2XDwT~$_Z>S36GLjfaX(W-3%cth0B?O@ffccd9nP^2UYXi03 z4uGbbTuq5S1&7(wk?e{h zVAQ9y(!U+Xu-73g-D=uy!XCaY0}{*g46Aw(uj3Y^`bK2@ecVX7t+Z{Sba#VZYI$;U za)t(vXQ(p)x&2Z1>e|kteyh;gzRHrGHZFI%Py~Mt0qoEdxHKWd^)3)GmjLTWKW3do zAjEvy9GP>k;}a@@mp%Hf?5FySdRRTR601M)xPFMIdDtwb#x(F{<^lxbF(}O2M7WWp zl2Z1I|46W47x`fC9WM8*U=}&;9?~EtEz$n{MNV}jhKm(Yw$~vO&R{W4Hb*>XipJ>;XH2Jpx|a+wMXI;lt6wo3Z)Ljs`DHXyJ)$LIq``b zD^gxc6cys%uUQ7+5cWzYV*7mU@Rfg|8&gPjCfdIbLD}~qVEcDktbY!{zmfonO8n{L7g&g|Bl-aN0_nVe5{2&8e+`xB zMjki8%CJ(Aq9@AD?tZ1GGLZ5Aq1*=~L5L@!tSX&ponNexPDz*N=h8YKH9L-P81rF9{!7(z-F7_b$_>=@tomyjdThM!y<6Bae zY{vdG=_1{p8)N}8ioS;C@(dr@R_)}T5C%c>V|b~c;5LhRi;iAu8)R}ulL@=&s@Zk6 z>}ySWoQ>vDwvcTPx>kHaVbZ+SX}@rki*GH~J4+^t9PC z=u|fHt=14)lle{6cYvOX)mZ&GBJ2{g$@KN8b~e?65RAYOh7N;tzih~EAExjN@1q+I z%{fZHMf2P&Y=78aW10S)9?~lu7_`s|<`1A++aoC^NWXxm+jurhppAHvH?dRhvT4g} zhq=&!vD%Yows`SWp3OsVWit8a_qg>5DDv6w@3>Lm9=CAtDXgJv-m&d;~GjW^oz$Nk(#o z1@_a2@uE@10q#}vxN(esT?KbwBA8PA?NrPEpYyT)cg5-dgKbER+m`sAk2Ta?uU_9) zg!RR|*tAsgGaqGH!bakI{!w92PLLRFM>=soXI*OIYUm4;7fv+@-Rlppk~yYy-;f~Y zcJ%Gk`t85CQyCv0$GhmhL<<5aHHdw~BEFM9lm%|p%#Hbwp&mQodTollzGque(8vY{ zR52gtrQ4dcCO!$xA&Ru#v!AX@CL$(HRaHtn!s|1duc@egD!o=UGEWK_r5cS7tNhs` zXU)qVDM>CVNreLwc-GFA*S^Fo;8zo42_DKC(|j8o_}K(;FZ+tK^h}zcEzqyTWWgS@ zh9q-VNo7ZrCv?L8M>F4XBPFc`LGn%7C|ap&BD@1pRflYD?8kcG=Bv?7FhDcF#Y3#* zBRajkVLtbCw0g{{;BLZUXNXE4Z14wHVE*azZ*o4JS@ma$C)d8`c`ZbJk2~_fGvavN z!>{FFkFc8!sb3(TVQQgHCSQ14xZrpu4#;GuWJm0@kuVUqKsRotYGY2ARIOEe##N}v zbX>=47@whw*!`#5H)A98{>QVNI>*K~_FtOT@KY!+UcqjB1B4c-kBRlkrvGYy$QybV zF8{s^o4$h=|CZeN&(Hsd7yXB2N>uui`3|dpKDi%`*(GRz2+1RcH;9hQ4`lzsvXF{^ zASDO;(yU6hckQ&eg3FKILw=zn1_~wR^}Q~zbJj$#j2DQXx|*2syq}!7`gpznAoJzm zJ{9JZ${c8jVh$6aDWuQe$D)R<=VV3+B8O&3?z7tEs@|;vc)&p7En(D+ufG#Db6+i2 zG_pH>tN{ti&V+3C6i?=zx8Hu>Rb89an+j^Ca#Z|_`WR}?UZ%#yU8jLIFGa^8Qht-2 zPIzqsHkga93Dl`Ym)3uh-Nbi}_SsrnFPardtK(KG0R0Alo=5;j>-W%a zv;YBaW_n*32D(HTYQ0$f1D}mzt}0b00pREwqaDs63=9t4-W0$vOrgWA$;f-Z?&gN` z#Y@8Jh((?U{Aty(@Y^H#kv>kR!#)il7cQQrqnK(M8+N!FX;TKysz_yWVeZyih+bxz zPFhwq*I9wiJQZaX@R@Fd zhm)M^g4J!ocM&Sr#Je(})eKrZfmJTtsBOj#%QhS~p?;xq0xat>K!`S6yqJ+fOHe7RiPEXH z=n0VtGLibuH)7tE89ep3(GVosQpm zp|j;a@eEz7Rpe-uw=-^hN9oU9&rT-Yo*rL_J%lQb4~8PawCJ#I-}SFFF?tvaaBG!b zTBym%9f;9t*5>+-4c`T6gEj75YQhMztT$#gMLkh}wXQgjGilvp^{t|I(d@IA0>GVn zVpcietfni2yDnL&wq|Q@girp$h%7qMbnk`ys)1-$xqmNOeHiRAOobh0h4dia@LIh{ zy#XGd*48bZ$YIF~Nt-&b2;LJ)iLy;M0aw48LMd|`3NK3}exvO%Kva$Hkbmypq|qc`#aotE2e&8Cg`toXsxK7lp#v2NQs4T)#v(*T` z4V-l$BJ&{B?HBmT8)3|K-ss)Yn$YH3|v82T4{qFo{drP++b-XdQ8sW`iIaxs@bhmv(W2Fxcau^uSMsEK>Rj z73{pi-93B=GkRE^q(gv}Me`lRD$4u##NtahUMW~WV<_G(mZgpxEkT>ktO&T}AiKv) zYPQQC9FaFTI5u-gy3R1+TJ&fCfwY)wTXYdcPDt(be=m1EX>Vna?{aVX*1{P79o+jr zI=)23ZJRl{?>rL)3bcdo`T_?kA{z$wVkc$8Dd{}$~`4ejC5hO@{QnXc#T z0QlFBFY^6Xn)J?tY@wU`ojVNF&?|( zbnfCK%xS|Q_1F^Kz7K?C~u(8lI(naxFtb;QU!&?z02`H&FF z!mkS)m6y@=PwvK@>EsMeD+WefGIOsvHuV@0?F+bwogS6kg5}ae=zx=nP;tE?I({Q9 zVRtg!inDjc7#8DG$VPEZA`5Im)BVEC9nv_2iK;;wK}ioH&CPgGbexUQ@(Sj9_!r)kvXCJ%encU1>SYu&bJCU4kM% zu&#jOS{6FHo~6ie5+zx|y)N0k&eb>APMu|luTQ!uedH$Hsv?C|)pDP8od%Zf@L%DB z?d11_^zWLo_?E2r{+*gqwzl}c2v(iS;|kx#LLQem@jm+B5D2$HA>`r^fywY7wJ~#Z zlu(rd>NV}eigu2Sg3_d8bT4$Y1!1Cz(0o0K*t*bc)*B~uYRT4w>&?@r zUBxz}*FN1|;CfKaECVr%Gk{uFjmY}Z+SHu@@koWD{1&W1mY!%e<_Q}MIwi={u_m2rB<#9V4J9>?*vl5oRZfXJTmY|e!7f;(GLTw$3dyXdC-ur& zs_ZQKr0CpVi2L-7ErFzqvnpB^fdXWKiYzKQQQ2%ZnB1O5i8%H>MR9pfj2#q3(f2sp zVrO!56^9YP@>1p*qBZ4b(z8B}iwWo#QPzJfZ2n5J5;l5WWJQI2))jQh@YnAnpn|kj!GlSHn`h1%4Pf10 z#$`L|cVl)t_`K}u(j}W>gTh}T{@E_S>wj}-5oWCtG&&=!2_|H?_mnV%zl1v9mRA+J zCMJ^31?>7-WTFszA&y6w3_lSx!8<+n4o@pN{Lvn?<(T0BQ29+UM7(g`QwA~LQZnP4 zU<-r)B?xOkj>kLd9>>fmqNQU{&&ZyHsS0l7`|r20kw*Fg+V}Ep%kOXy>A!Ju{=wRr z>gIY{gR!3yX{l`P-^*cF>v;4mcY)877@BGh6?uPPO0p)^#==jixyOm%O^2i+HnD$i ze?W{vh|)s_^3w|j@ozPP_FI*1=|dX1LRy)u(_anX@r5O@{4qT2{jrrkJ8^;;`Yz`p z>!R$W?6kPNC|ix|@r2;3ey4=Td0YGEQ?Ht>j(7H!;}2=V^6W0W$^`7 zI4ep!?~O!v5~B<=*F@yi7{w_Ts5@e*KyKL4voF&)g4EC{VF$Szr8e2F46~Y@w1hMV zB%|OUt0FB_LN@$5!IPUVer2bGG~Q`Jtd_L+EQLyuIkjw*8Ta0}ElPt!T7GJ#Kxo*& zonOLfp)?We+vTM-Y)^7ym3oj22{2xeP&!pdpt(j%`AtU70i5Ar?K>M$lchY5>M(Uj~|*+YrLz+Z9N3Kui`=?Fe|1= zh!)mB7k+gDHRK;^CKd1GKRWJjSI>*YMszDj=op$RO-x?XI{$YHU5cHrjt6NIvle|B z#L$juDFK31N_xp**g>|YiJyMW_!Wp>UXUE`c*Np>XD~WQ6<0EWeTxkBn;XiVq$xQnv48#Lm*K9f1Q8ZhUc3t@ zaByP4iMp@`I;U1fwS$bkGAwxxx!D;{Fr(r!oG;(WaktP|&V_b?=8BQmip6Luj5$0| zhc~53_*^ZlbQ-2(Y8FF)29@X0^xnMcQ5Se~#b*hLhQt+n2DLTSmsT`OMuM0oSz=k* zm^XohSF%XMksLI`ycclL8ia^bIX9+^&a4uqXvT>sPv0wq!P{{4E3DjB=sm@V$Y7%! zC+sm1RYq9hN$~{yN{e7VltX_cA)c|!n;*q?dYXczgf!fg(noPLrnnxesgD==To z8kL8^Xe6-n;aMKLfz8PlRF#MSv?4>??F%vaeY|2;u^2((FqEY{<}^6LdJYlC1ZqB3 z2{oA5)w({3mp4GtYs<#=m=-G}^`WExESws{F`1^KHG35pCaemZYTNP4S&coDVz1)h z8*Z79OCNUVzXp0;MeWe`E?DxliQF|%2gv+p-JXPDdv`g^VtVM@?JFJ?P6J_C73sK& z0ASccOU!}Lgai6b!cl)%Gh6~G=;U>AUOIwkc2>p3YGZLOhFEDwM3HA02;!~cRX5T<+xEU;Np547z(7REiT>>AxDj?=02(=YF7$%UbodGTeWgW)mhUq%ohVGsscH}xZ zFvAmi7P59!*J~lG8ifrnwf6T!fOnxnfy+8QVkBu4a81qdeDepEiW>$<4BTR0#DoQW#Xh48w zkOr5#77d`5aa;OS*H+0?*2SoI*}r^XC-_7qOqyh=csx#Lg>hkQ;q_?!}lL-SJD0?H4&BRTO`(T7`&1=fH z0g9@7?8b;wGwu11oSm{o@(2a)+v}dEcFaqdFJr`Tp%QNrqmIDFSa17nefwd?;NaEU z(#gt`FJTu}HP<`XFin|1%8^^}AmpUB1EQQ$c0SzBm)=_Eg<(8417DwupI)rljtaNr zZ!AN8cyEV!L^3VFlg#OVE8?Kq_gdBKK8{@L9YI6kM5O`k4C2vLnrurQ>zRO>*pd){ zz3B0|ccsUkB^<*IiL?N3Kcj2iHMHJbD41!e)8V1H5xSTc=e~^O90+yHjLh1Wa+A!h zsoiZ6;mE2e)6``%fiuL#d5-M={fwoxF9fU!#-A*n=IWKM&w6fl-e<0p zdsn$Tzxt~Hkl3`0vvVNwF?#PRg}gj1OfgXZX(wfV=*t!t0bR$4n!F}W{m&0LlNF>A&2Jm-taK&Yln0GU5z zg!R9P+|Jc4c&$~?;e0^r=y@EmV%*K6r^IyM+Jo+v?U}Zaph@_=ol40*wb0{(PeHbw z>xTsnVu8b9`43^L!`Rw3ZM>{%%-%P=J3nCihI4UopHu_=f*oEV;eU>t>SB?$kzDv;~WH^`S`elYG z*-6@0jA_omI-bj}^^@vts~0>)LPgL8s+ErVUw*UB zn`>FfTXiWa>Yw|TgrdG!mqU0}+vBytAJ2b>*|<^jXExZ(40s1!Ut^ay;5%C{%nu$2 zbZvhO{fsa>86G*RgW~X&k394u-+}H!zIo7Z&};6f5()C}?n}|IG45FpuWdi9^=+;x zLEm@I&%xhMM?DW5^0LP-2JU1xXOkf`?vdP!_h6`9Lce+3LqXD#@fSzqSMJfQsX>po z@MJYcqzFT;M4JJ6KWrV@<4Ke*#febLn_ z>w@cZkC(cLHm<6wz6*Xncuo@WbSZYya>K>a#F$Q|dc{UKB&?WBzW0e+N)Jg&82PLQ zj>?XA{Sm?dxM?5gAqP{{fM{M1+0cp!ZwQS$68d&|B}{jputRd}xdt{nA9Q$@l1OjN zwPBRPEZM+OjDqt}$}*WW&=}cSj4W?1h_)37eOx+ZRA=B&{?i+b>yYDNWV}UbYk=)Q zP>aH+hvg2lDxPoOodbaFV4spi`Gh}cc6QhgZ_BsdPLKH=`oZCekYCCWnS}93Y+G@} za!L0GzeR8iHDvG>isJs$IH~dIu+43%6sAgXN?`AKa`S4wTD&sOfq!yL+ooa`CK*a5zP0v<5_Vz--GC62C>eyW3Jv6(Yq3-K%NWL6Xy!!|CEm|)Mz%W>E z8o}p}6cv@1RSD1*Et%D)=A1BlM=CzT0YvvVP&fOXK}KZ{D8k`P?nVeeRZiT)*pEM% z=FU_qeKs+p%;7KvQdJQe#e{H?@5!Jesxq)<)e46sH(6w?SKJ)^FkwkxQ^6~{Jy>!L z?-0%cPaPB9Qg7@EGm^=Q4d9)a>IGPIM!an+Kj=s0)XsqsL{vM{mxvH33e!z(xV#6{ z`Ke{~DFS`$k{wC!l};Mz_P4M{A9wg2cg30(J!DExlI6~DOy0jNOTs*m^C+sdVS>|8 zKQbY|-cZxXWaaYAPh&a(6n8nMC$E#4Ax1dG1^7U`kbyP)eNt<$z# zeKqf8_zvmg@OpT5%}K7@-KjUNJ3r7^Rf>FD;loeDy{U_?lNQ`5X zXHyC%i3!D^8iGWLS`tcKhJXqJ60@d+&adg%I-N)y%VpG8B@euw1mA7gj8|K2kPH>G~2^m))x1XKx$48W}sSyxP{S^wVRF|HV zSk#xKrLp;$DhJ9vDqaY%EILEM2Ie>ubBPA(l^rv|ENJbGe@9V+j@`0`*N(IrXNb+t z205{qs|n4g|1uYbn6-A<23RGq1$3V8EW-~7xP9?syH(BlAPhezomNa`j4br9Fz z)=~FT)xlItaCuX3-KK2-mJdlf2&(s_-7;NWiW66eC_FeWNyhAkMMLJM8Npo?+Ozl3 zBevk_Vd?ByzGrXwCsVhv6s(Tp+}Ppw3y4LwYlS3-2BbkP8R^(QNOla#O~s?%vbkoe zBg7QnQr#UJByEJVsd2iM+}^v!s~Q^P|b?a;Rxpn}(?tsFwEWKETpFp4?3BvCi5gy4)HQYE#UD<7N|{(C=aHd(2(eQrshhDxlelF8qM>` z?!0>eag8!)0GMz9P1*xxHa$t6>2EWBNqBCD`#9Y24Ad)Tu`6xK*_p{(M;4Dbj0LQy z%O9jFpEv&AJWr7I^R~32?HCc~v6<%wf!D(hX9T6A8GT&3cqG%Ov}t_I^NJRnkCk?) z40aie{3tP3S-krhh($@gBH7JJs$BGY!0`02RLo%7Lxm;5!mS%1%yUC9v`4f>ieE4H z#l!OqX^|s43*g(cuhNd>V;JW(jq>3?_#5Zu!R`cQIIF)&sZ$kIb0@Y*8LZGeMsTds znrK>jN8=W3HoVhJ8%0!N;w!@&QL5YHfg-HJ%tTy__Huju0)K2$Wl{|%)5`w*z1p=m zqk(I6-12zJ=u`GR8QMYSslPAtZ@0EflK#cS$XoUTvUzAD5C{~PM{Op$pD8|ftE~PX z{g+?P+@KCOnx(#?cP%8e!)k;X?=ysdA>^SgL=k26OVx%=wa~L|(d(mYv!{8dcze6j z_h|LI<1^Y z5rl?QRzUbq<^7^<3Nrw4iZW@%LvB%uj&Gr+rJ~GIy%hkFrYABRAUnS$q%D0>;?e0F z*YC*NTZCx#;`B%J6dANYbnJuKuiyJ@rPo1!W(yoV9-N|E*bi?ZPSQpCp{sJ6NZ*CU zkKUycUA-@@e-CT-x2UC~bWalsYqBGg!6ArFWmEw1t)0(NT zZ%ah9P*p#+ogxb4pG<{n=s1{w6yf)5Pnc7k->i4J$D=#oy!(LeDbH6emaBR=LFm?bmTzLCYIaUSX9i+(Np3Ech~* zZHTPZ`qMW7@!C0m)ySk|8>=iz9uk3a={c)1BmX_(iy>YbGwBzbB70ITRD;4)n5Re3 zv3feudeh@Wv$Z^3LRkfij>W8`O&Xe0GmItv={wtBH*eWd&MAov7wPat zRX+eoZInHV$FwzpEE#?ASl&^}UDi!0=un=cDFEG_WE^xJtRnhKeVAkBcPLe5t$F(B zdMxkAZQBM_DexyTjp?KgPItFnTep?d7nJi;%7+2_B3wz#V@$6<-6N=m@0Eb_ma<*2 ztl1m5s--y1ew_AvXWGOBMlS{P^oSw+WJ3-`l?LTUxly?Y@u^I6d#dM}QeckO61;u5 z*oLSY({aV(R;c;E4J-16B^vd3ZXp@#!TXInjaahq0>{!8;$%ZPqW!!dTfeZcQFyZ1 z>`NnKReAcFyh{VoCo(Ecg&r#L7$AT&J50!dWuZCSI$7O;2*rs6tQS_bbKP5x$#Btj|uuR!tp8n*%I3T z#I*o#zgxZ75dLNmV{k-117H-Xi89zDKYCfrph%G{*9i8aW)#fi>{Od&bOn&EF~ftt z+7Pq>z)@g8x%{iNrNriHjL8#Tcz|$oqk6D3K2kKbzn0Hlx!8MjN0IXyEo3x@M3g3*q)7 zf=$>mM3McVz#U|myVoDXx{f+xFGNmwCa95_dZ&z|Bvtyn?%{DPH&dD&SoE3s&_z0x z;~M43AnS-z%h+87s-#;(dqrM5{(uxI-x``q{p*WxUWkEWpcdlud)Nt*NWi7ZdDIrC z_*E;|%V30~wZFY1*p<%OpJEBchiO-F5;>!XwzZz1kddp zLZ#w8zx>=scB@Ztd0c#j?z|9PpBNz*-EK)g4%Ib=AD#i#u%c_fz|}vELP1yJH;%_G zBIz&kcdB@=G(LXklqV+FuusvJHyD%Dgh&vGat^kil{edhO2WkgZP$cFd57ALEfGEm zA{ooH`(!1zw_6z}?LjLUIq8nv7yXTl)rjW5#`YLa&C~01FLasqF-bD~i?@MUFJQU& zSK^=jJ}|QE;-6WsfAZ7xKB+J(n3l$B6d_yYh*tf=XlZKuwE1eZmsuk&H(f!fH*$*- z=8VRBrHYD*9hKoEhI<&FNX$4HtbcL+-fc8Vrj^C=axFkI+|CN6am>_(t&OL%n-LR| zXL0(#i=SzkCh-Z&b)93uyM`NMyhTR&m(~3<4n_DN8BWx=fa0lu|1Wo@HZ_;#WnRA` zFqhUtg=`xdz#g5)lATxmS6KhH?*TGIn9kY;$7BRg7*A5X&9B*MBPkOrMH%aA`I`Ybng+8#5_=~W4X{{&s zp|@|-*oP4uBv0IA7toH!!d(J7dy@Ny_DjwVaC~P;D|)N5{HHp?{K9H-kn(a+Nk${B z{~CaG+Xi)9`xa=0zdbJ0|5IlAA7J1gd)GgZAo4rry6_u?XS4cB)X(^@9Ed(@ps{>e z$;(f|5Hm3q2K9j6W_=e0u=dNMOQhZ68_T_L_>>Y5@dZ<#gj*R+J$2&S-1*dXk7=Ic zjqk;++de;1`r?`E$jeg1i2Mzpa9gs94gq1K#1G6!EvdaUQY3boUDqWoRNM3Rt;Ks? z|EIDufroPId>lu~1>khSb`Z}t=!`zW%eR6~<(n0XDNNTWf@b}bdxZX%T;np@o~ z(jpSKP@+_Hy(&v?mP+^bo{8~rj4|)&GoP_^zP~ePd(Lw_=l4G;fL^t`kw|tiVN}*L z&USsIm7Jk{c%)>R9*x(!@`lVOub%65yrN#sRP#t;S$u}Rid7@pCX|9Mh#q$0D>wVy z`ks^`e)vp6hryw}6~U=;H&Wd3y($#i=Gfb3f0I37m4Co6CP43!Z(x-N`X5osp1tms ze%c3}6kDxdVi;xvDg5Kk=TLkvqlYWfL@LvboWsVW+U`h~6rz383{`x@j1I34O>A9u z(OF!w(7xw%ab7W5$HpM}K%Mf9$YGm+jk=D;r>mTjH9CcgYjXwbLtab1OI>AUy5g{C zP+qH{X$!n|DOCvC7Z1h zLb#ijLmCEVemlBALG`lx+>j-CJM z{h@xv#Js&KqkRhBOy1ko*g1^9E1Qrp(!v^?%anZ^SMoN$#p>Wa#eciXlWFTD1ES($ zH&V4-ltR*P33%k}#G;=mJh;o#As5=>+aU21_EK|k|9@jb19hYPwg}ym-xdxYfL#h6fHhzqHN zYkcGRSE)zjf>t}WM{V$3mj0`ekRsBM<`vXf`EFyewPD2G@^lO3*a69qCC@P{(GljB zE`En-IER~AWiM9AR!j4{Uk=#yOt;C+#-Op<(;EA!y|FJxLO9WFXBeaS><3EcaP&*( zzo~{Dmbt3xpYxQDABzsC^mB-j_Y4fixsHDJ@(yo#wk?L1;9ELcW8OHntM9o~DYh@8 zuPLcd@fq&(3&k|dQ~tzN!->&}k}9$L;?Dn7wRQCA2?Hg$*v-@qnn$E{Tf&&2xYXs+ z_LD(>AN;Ua#b*3^n-u!hwIU%`r>>7{oU5eb3t#wbl-7!T;3rgjJ92pfS?_rEApy7Y zS9*>cy#}|gS#39hFKYTV!#^#)X~5`sPNONB&!GZCky=_LR?Jg)3KK5)P-{=pn-RD7 z|KV4UFm2h_XU&_LWA-qv&zCnd!%S81{Fg%;N=8@A{_{GzSaQPzz=BLBF>Q^P|%BeNnwjwq79i}r|@D4J&`6WOqN zeY4?>G@M^Cmc%VrU_17)(9zUH(3Np8iJwT-!F6ng7(=exsw5C*3 z$^`UBU)w+AjcY3CzPctu1(Qyh&@|3*@)ERG>GdpMP7qb49B)w7x`l3AJg7h}x;0XH zOs6_OLo-O7?~z)8VTm_**C=p9U)bW;@Ae%!8vjrG)&fz`lo;@0df-oa--Bn=Is4xK z#g*H=;%p+BqtiVPugD@`558mx$YcUuh-p4BSDQ-0sDU59vNdxwQMcM|u4!j8JDY#` z79(TupPA21fk;WyiB1KNgrKIg*_v#(GB2B@A%#i?(d?zypHcFT)lO%(98W6yOD8?n5M)czS{wx5WqGz2>X%9Wh`BayD&NpQEt}Go42UWTnwA<_|%>>Wwvn$^e4>v zR$*TaG$)R%LWU<(G(D&=EHM@W|V)P*a|Qn z4hw+b3E`aZ&|L|Ph28KG?7aw1*qPfsFcbDhMwm-!oR~lMl;&Nk!8XJQb&MP8{HDZk z@nIuXL@4_N7sa1zs|pLiwv~uL@+mF^IG9+%O0bI^qVyq&3ni{R?O;vVhz!xpO5sA2 zlPwu61)H)UQWF_mNO7=eft6tY3qjn5ACL*xp{QoJiP>sQd;1H>C zumXmzaWkg(sYz|Yx`GcxA$*%sF8G{}N5KsPpCLiSqRSQ*W8W6=(*p?eRqY(+kLsBF zECF0j_>T|>v%g_sCZ}r@ymgC^g`4J*x!=fzKLNa*i0Hg+o}&Y=W@mJx1uo<878fG( z+vDkl-FzEfaG9BzS*t|m?iMT2se)iLW5(_odEUJ)I~zW5%Y{PefPe47&D?g75rz66 D613UA literal 0 HcmV?d00001 diff --git a/samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..94920145f3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/java/jersey2-experimental/gradlew b/samples/client/petstore/java/jersey2-experimental/gradlew new file mode 100644 index 0000000000..2fe81a7d95 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/gradlew @@ -0,0 +1,183 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/java/jersey2-experimental/gradlew.bat b/samples/client/petstore/java/jersey2-experimental/gradlew.bat new file mode 100644 index 0000000000..9618d8d960 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/java/jersey2-experimental/pom.xml b/samples/client/petstore/java/jersey2-experimental/pom.xml new file mode 100644 index 0000000000..3affc56f00 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/pom.xml @@ -0,0 +1,293 @@ + + 4.0.0 + org.openapitools + petstore-jersey2-exp + jar + petstore-jersey2-exp + 1.0.0 + https://github.com/openapitools/openapi-generator + OpenAPI Java + + scm:git:git@github.com:openapitools/openapi-generator.git + scm:git:git@github.com:openapitools/openapi-generator.git + https://github.com/openapitools/openapi-generator + + + + + Unlicense + https://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + + + OpenAPI-Generator Contributors + team@openapitools.org + OpenAPITools.org + http://openapitools.org + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.0.0-M1 + + + enforce-maven + + enforce + + + + + 2.2.0 + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.12 + + + + loggerPath + conf/log4j.properties + + + -Xms512m -Xmx1500m + methods + pertest + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory}/lib + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + add_sources + generate-sources + + add-source + + + + src/main/java + + + + + add_test_sources + generate-test-sources + + add-test-source + + + + src/test/java + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.1 + + 1.7 + 1.7 + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.1 + + + attach-javadocs + + jar + + + + + none + + + http.response.details + a + Http Response Details: + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-version} + + + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-databind-version} + + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${threetenbp-version} + + + + com.brsanthu + migbase64 + 2.2 + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.6.1 + 2.30.1 + 2.10.3 + 2.10.3 + 0.2.1 + 2.9.10 + 4.13 + + diff --git a/samples/client/petstore/java/jersey2-experimental/settings.gradle b/samples/client/petstore/java/jersey2-experimental/settings.gradle new file mode 100644 index 0000000000..03db425dc2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "petstore-jersey2-exp" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/AndroidManifest.xml b/samples/client/petstore/java/jersey2-experimental/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..54fbcb3da1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java new file mode 100644 index 0000000000..30609a4a8e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java @@ -0,0 +1,995 @@ +package org.openapitools.client; + +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.Form; +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.TimeZone; + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.openapitools.client.auth.Authentication; +import org.openapitools.client.auth.HttpBasicAuth; +import org.openapitools.client.auth.HttpBearerAuth; +import org.openapitools.client.auth.ApiKeyAuth; +import org.openapitools.client.model.AbstractOpenApiSchema; + +import org.openapitools.client.auth.OAuth; + + +public class ApiClient { + protected Map defaultHeaderMap = new HashMap(); + protected Map defaultCookieMap = new HashMap(); + protected String basePath = "http://petstore.swagger.io:80/v2"; + protected List servers = new ArrayList(Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io:80/v2", + "No description provided", + new HashMap() + ) + )); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + protected Map> operationServers = new HashMap>() {{ + }}; + protected Map operationServerIndex = new HashMap(); + protected Map> operationServerVariables = new HashMap>(); + protected boolean debugging = false; + protected int connectionTimeout = 0; + private int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + public ApiClient() { + json = new JSON(); + httpClient = buildHttpClient(debugging); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("petstore_auth", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap(); + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * @return JSON + */ + public JSON getJSON() { + return json; + } + + public Client getHttpClient() { + return httpClient; + } + + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + public String getBasePath() { + return basePath; + } + + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + public List getServers() { + return servers; + } + + public ApiClient setServers(List servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + */ + public void configureApiKeys(HashMap secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + if (secrets.containsKey(name)) { + ((ApiKeyAuth) auth).setApiKey(secrets.get(name)); + } + } + } + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * @param userAgent Http user agent + * @return API client + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return API client + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return API client + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return API client + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(debugging); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * @param tempFolderPath Temp folder path + * @return API client + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param connectionTimeout Connection timeout in milliseconds + * @return API client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * @param readTimeout Read timeout in milliseconds + * @return API client + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * @param dateFormat Date format + * @return API client + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()).size(file.length()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + entity = Entity.entity(obj == null ? Entity.text("") : obj, contentType); + } + return entity; + } + + public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{ + + Object result = null; + int matchCounter = 0; + ArrayList matchSchemas = new ArrayList<>(); + + for (Map.Entry entry : schema.getSchemas().entrySet()) { + String schemaName = entry.getKey(); + GenericType schemaType = entry.getValue(); + + if (schemaType instanceof GenericType) { // model + try { + Object deserializedObject = deserialize(response, schemaType); + if (deserializedObject != null) { + result = deserializedObject; + matchCounter++; + + if ("anyOf".equals(schema.getSchemaType())) { + break; + } else if ("oneOf".equals(schema.getSchemaType())) { + matchSchemas.add(schemaName); + } else { + throw new ApiException("Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType()); + } + } else { + // failed to deserialize the response in the schema provided, proceed to the next one if any + } + } catch (Exception ex) { + // failed to deserialize, do nothing and try next one (schema) + } + } else {// unknown type + throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); + } + + } + + if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf + throw new ApiException("Response body is invalid as it matches more than one schema (" + String.join(", ", matchSchemas) + ") defined in the oneOf model: " + schema.getClass().getName()); + } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas + throw new ApiException("Response body is invalid as it doens't match any schemas (" + String.join(", ", schema.getSchemas().keySet()) + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + } else { // only one matched + schema.setActualInstance(result); + return schema; + } + + } + + + + /** + * Deserialize response body to Java object according to the Content-Type. + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + String contentType = null; + List contentTypes = response.getHeaders().get("Content-Type"); + if (contentTypes != null && !contentTypes.isEmpty()) + contentType = String.valueOf(contentTypes.get(0)); + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param schema An instance of the response that uses oneOf/anyOf + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI(String operation, String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + String targetURL; + if (serverIndex != null) { + Integer index; + List serverConfigurations; + Map variables; + + if (operationServers.containsKey(operation)) { + index = operationServerIndex.getOrDefault(operation, serverIndex); + variables = operationServerVariables.getOrDefault(operation, serverVariables); + serverConfigurations = operationServers.get(operation); + } else { + index = serverIndex; + variables = serverVariables; + serverConfigurations = servers; + } + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size() + )); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + WebTarget target = httpClient.target(targetURL); + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request().accept(accept); + + for (Entry entry : headerParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultHeaderMap.entrySet()) { + String key = entry.getKey(); + if (!headerParams.containsKey(key)) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(key, value); + } + } + } + + Entity entity = serialize(body, formParams, contentType); + + Response response = null; + + try { + if ("GET".equals(method)) { + response = invocationBuilder.get(); + } else if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + response = invocationBuilder.method("DELETE", entity); + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else if ("HEAD".equals(method)) { + response = invocationBuilder.head(); + } else if ("OPTIONS".equals(method)) { + response = invocationBuilder.options(); + } else if ("TRACE".equals(method)) { + response = invocationBuilder.trace(); + } else { + throw new ApiException(500, "unknown method type " + method); + } + + int statusCode = response.getStatusInfo().getStatusCode(); + Map> responseHeaders = buildResponseHeaders(response); + + if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { + return new ApiResponse<>(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) + return new ApiResponse<>(statusCode, responseHeaders); + else + if (schema == null) { + return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType)); + } else { // oneOf/anyOf + return new ApiResponse<>(statusCode, responseHeaders, (T)deserializeSchemas(response, schema)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), + message, + buildResponseHeaders(response), + respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, just continue + } + } + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, schema); + } + + /** + * Build the Client used to make HTTP requests. + * @param debugging Debug setting + * @return Client + */ + protected Client buildHttpClient(boolean debugging) { + final ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + performAdditionalClientConfiguration(clientConfig); + return ClientBuilder.newClient(clientConfig); + } + + protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { + // No-op extension point + } + + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams, cookieParams); + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java new file mode 100644 index 0000000000..6c91e35f27 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java @@ -0,0 +1,91 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.Map; +import java.util.List; + + +public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java new file mode 100644 index 0000000000..4a3226d1db --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + private final int statusCode; + private final Map> headers; + private final T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java new file mode 100644 index 0000000000..acbecda489 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + + +public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java new file mode 100644 index 0000000000..83d4514b07 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java @@ -0,0 +1,232 @@ +package org.openapitools.client; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonTokenId; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; +import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; +import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; +import com.fasterxml.jackson.datatype.threetenbp.function.Function; +import org.threeten.bp.DateTimeException; +import org.threeten.bp.DateTimeUtils; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZonedDateTime; +import org.threeten.bp.format.DateTimeFormatter; +import org.threeten.bp.temporal.Temporal; +import org.threeten.bp.temporal.TemporalAccessor; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. + * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. + * + * @author Nick Williams + */ +public class CustomInstantDeserializer + extends ThreeTenDateTimeDeserializerBase { + private static final long serialVersionUID = 1L; + + public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( + Instant.class, DateTimeFormatter.ISO_INSTANT, + new Function() { + @Override + public Instant apply(TemporalAccessor temporalAccessor) { + return Instant.from(temporalAccessor); + } + }, + new Function() { + @Override + public Instant apply(FromIntegerArguments a) { + return Instant.ofEpochMilli(a.value); + } + }, + new Function() { + @Override + public Instant apply(FromDecimalArguments a) { + return Instant.ofEpochSecond(a.integer, a.fraction); + } + }, + null + ); + + public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + new Function() { + @Override + public OffsetDateTime apply(TemporalAccessor temporalAccessor) { + return OffsetDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromIntegerArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromDecimalArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { + return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); + } + } + ); + + public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + new Function() { + @Override + public ZonedDateTime apply(TemporalAccessor temporalAccessor) { + return ZonedDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromIntegerArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromDecimalArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { + return zonedDateTime.withZoneSameInstant(zoneId); + } + } + ); + + protected final Function fromMilliseconds; + + protected final Function fromNanoseconds; + + protected final Function parsedToValue; + + protected final BiFunction adjust; + + protected CustomInstantDeserializer(Class supportedType, + DateTimeFormatter parser, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust) { + super(supportedType, parser); + this.parsedToValue = parsedToValue; + this.fromMilliseconds = fromMilliseconds; + this.fromNanoseconds = fromNanoseconds; + this.adjust = adjust == null ? new BiFunction() { + @Override + public T apply(T t, ZoneId zoneId) { + return t; + } + } : adjust; + } + + @SuppressWarnings("unchecked") + protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { + super((Class) base.handledType(), f); + parsedToValue = base.parsedToValue; + fromMilliseconds = base.fromMilliseconds; + fromNanoseconds = base.fromNanoseconds; + adjust = base.adjust; + } + + @Override + protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { + if (dtf == _formatter) { + return this; + } + return new CustomInstantDeserializer(this, dtf); + } + + @Override + public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { + //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only + //string values have to be adjusted to the configured TZ. + switch (parser.getCurrentTokenId()) { + case JsonTokenId.ID_NUMBER_FLOAT: { + BigDecimal value = parser.getDecimalValue(); + long seconds = value.longValue(); + int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); + return fromNanoseconds.apply(new FromDecimalArguments( + seconds, nanoseconds, getZone(context))); + } + + case JsonTokenId.ID_NUMBER_INT: { + long timestamp = parser.getLongValue(); + if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { + return this.fromNanoseconds.apply(new FromDecimalArguments( + timestamp, 0, this.getZone(context) + )); + } + return this.fromMilliseconds.apply(new FromIntegerArguments( + timestamp, this.getZone(context) + )); + } + + case JsonTokenId.ID_STRING: { + String string = parser.getText().trim(); + if (string.length() == 0) { + return null; + } + if (string.endsWith("+0000")) { + string = string.substring(0, string.length() - 5) + "Z"; + } + T value; + try { + TemporalAccessor acc = _formatter.parse(string); + value = parsedToValue.apply(acc); + if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { + return adjust.apply(value, this.getZone(context)); + } + } catch (DateTimeException e) { + throw _peelDTE(e); + } + return value; + } + } + throw context.mappingException("Expected type float, integer, or string."); + } + + private ZoneId getZone(DeserializationContext context) { + // Instants are always in UTC, so don't waste compute cycles + return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone()); + } + + private static class FromIntegerArguments { + public final long value; + public final ZoneId zoneId; + + private FromIntegerArguments(long value, ZoneId zoneId) { + this.value = value; + this.zoneId = zoneId; + } + } + + private static class FromDecimalArguments { + public final long integer; + public final int fraction; + public final ZoneId zoneId; + + private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { + this.integer = integer; + this.fraction = fraction; + this.zoneId = zoneId; + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java new file mode 100644 index 0000000000..6517dc877a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java @@ -0,0 +1,47 @@ +package org.openapitools.client; + +import org.threeten.bp.*; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import org.openapitools.jackson.nullable.JsonNullableModule; +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; + +import java.text.DateFormat; + +import javax.ws.rs.ext.ContextResolver; + + +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + mapper.registerModule(module); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java new file mode 100644 index 0000000000..ae89aa6145 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + + +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + if (arg.trim().isEmpty()) { + return false; + } + + return true; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java new file mode 100644 index 0000000000..9509fd0898 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + + +public class RFC3339DateFormat extends ISO8601DateFormat { + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java new file mode 100644 index 0000000000..a1107a8690 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -0,0 +1,58 @@ +package org.openapitools.client; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +public class ServerConfiguration { + public String URL; + public String description; + public Map variables; + + /** + * @param URL A URL to the target host. + * @param description A describtion of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replaceAll("\\{" + name + "\\}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java new file mode 100644 index 0000000000..c2f13e2166 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java @@ -0,0 +1,23 @@ +package org.openapitools.client; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java new file mode 100644 index 0000000000..266c26be3a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java @@ -0,0 +1,61 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client; + + +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

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

    + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java new file mode 100644 index 0000000000..e06e72ecac --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -0,0 +1,104 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class AnotherFakeApi { + private ApiClient apiClient; + + public AnotherFakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public AnotherFakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client call123testSpecialTags(Client body) throws ApiException { + return call123testSpecialTagsWithHttpInfo(body).getData(); + } + + /** + * To test special tags + * To test special tags and operation ID starting with number + * @param body client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags"); + } + + // create path and map variables + String localVarPath = "/another-fake/dummy"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java new file mode 100644 index 0000000000..d077830e35 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java @@ -0,0 +1,1198 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; +import org.openapitools.client.model.XmlItem; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class FakeApi { + private ApiClient apiClient; + + public FakeApi() { + this(Configuration.getDefaultApiClient()); + } + + public FakeApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public void createXmlItem(XmlItem xmlItem) throws ApiException { + createXmlItemWithHttpInfo(xmlItem); + } + + /** + * creates an XmlItem + * this route creates an XmlItem + * @param xmlItem XmlItem Body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { + Object localVarPostBody = xmlItem; + + // verify the required parameter 'xmlItem' is set + if (xmlItem == null) { + throw new ApiException(400, "Missing the required parameter 'xmlItem' when calling createXmlItem"); + } + + // create path and map variables + String localVarPath = "/fake/create_xml_item"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/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 = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.createXmlItem", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output boolean -
    + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/boolean"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of object with outer number type + * @param body Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output composite -
    + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/composite"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + return fakeOuterNumberSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output number -
    + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/number"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + return fakeOuterStringSerializeWithHttpInfo(body).getData(); + } + + /** + * + * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Output string -
    + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/fake/outer/string"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "*/*" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testBodyWithFileSchema(FileSchemaTestClass body) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(body); + } + + /** + * + * For this test, the body for this request much reference a schema named `File`. + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-file-schema"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * + * + * @param query (required) + * @param body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testBodyWithQueryParams(String query, User body) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, body); + } + + /** + * + * + * @param query (required) + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); + } + + // create path and map variables + String localVarPath = "/fake/body-with-query-params"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client testClientModel(Client body) throws ApiException { + return testClientModelWithHttpInfo(body).getData(); + } + + /** + * To test \"client\" model + * To test \"client\" model + * @param body client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); + } + + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); + } + + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); + } + + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (integer != null) + localVarFormParams.put("integer", integer); +if (int32 != null) + localVarFormParams.put("int32", int32); +if (int64 != null) + localVarFormParams.put("int64", int64); +if (number != null) + localVarFormParams.put("number", number); +if (_float != null) + localVarFormParams.put("float", _float); +if (_double != null) + localVarFormParams.put("double", _double); +if (string != null) + localVarFormParams.put("string", string); +if (patternWithoutDelimiter != null) + localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); +if (_byte != null) + localVarFormParams.put("byte", _byte); +if (binary != null) + localVarFormParams.put("binary", binary); +if (date != null) + localVarFormParams.put("date", date); +if (dateTime != null) + localVarFormParams.put("dateTime", dateTime); +if (password != null) + localVarFormParams.put("password", password); +if (paramCallback != null) + localVarFormParams.put("callback", paramCallback); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "http_basic_test" }; + + return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + } + + /** + * To test enum parameters + * To test enum parameters + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid request -
    404 Not found -
    + */ + public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); + + if (enumHeaderStringArray != null) + localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); +if (enumHeaderString != null) + localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + + + if (enumFormStringArray != null) + localVarFormParams.put("enum_form_string_array", enumFormStringArray); +if (enumFormString != null) + localVarFormParams.put("enum_form_string", enumFormString); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + +private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + } + + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + } + + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + } + + // create path and map variables + String localVarPath = "/fake"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); + + if (requiredBooleanGroup != null) + localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); +if (booleanGroup != null) + localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + + public class APItestGroupParametersRequest { + private Integer requiredStringGroup; + private Boolean requiredBooleanGroup; + private Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + private APItestGroupParametersRequest() { + } + + + /** + * Set requiredStringGroup + * @param requiredStringGroup Required String in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredStringGroup(Integer requiredStringGroup) { + this.requiredStringGroup = requiredStringGroup; + return this; + } + + + /** + * Set requiredBooleanGroup + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredBooleanGroup(Boolean requiredBooleanGroup) { + this.requiredBooleanGroup = requiredBooleanGroup; + return this; + } + + + /** + * Set requiredInt64Group + * @param requiredInt64Group Required Integer in group parameters (required) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest requiredInt64Group(Long requiredInt64Group) { + this.requiredInt64Group = requiredInt64Group; + return this; + } + + + /** + * Set stringGroup + * @param stringGroup String in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + + /** + * Set booleanGroup + * @param booleanGroup Boolean in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + + /** + * Set int64Group + * @param int64Group Integer in group parameters (optional) + * @return APItestGroupParametersRequest + */ + public APItestGroupParametersRequest int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + + /** + * Execute testGroupParameters request + + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute testGroupParameters request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    400 Someting wrong -
    + + */ + + public ApiResponse executeWithHttpInfo() throws ApiException { + return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + } + } + + /** + * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * @return testGroupParametersRequest + * @throws ApiException if fails to make API call + + + */ + + public APItestGroupParametersRequest testGroupParameters() throws ApiException { + return new APItestGroupParametersRequest(); + } + /** + * test inline additionalProperties + * + * @param param request body (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public void testInlineAdditionalProperties(Map param) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(param); + } + + /** + * test inline additionalProperties + * + * @param param request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { + Object localVarPostBody = param; + + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + } + + // create path and map variables + String localVarPath = "/fake/inline-additionalProperties"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public void testJsonFormData(String param, String param2) throws ApiException { + testJsonFormDataWithHttpInfo(param, param2); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); + } + + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + } + + // create path and map variables + String localVarPath = "/fake/jsonFormData"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (param != null) + localVarFormParams.put("param", param); +if (param2 != null) + localVarFormParams.put("param2", param2); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * + * To test the collection format in query parameters + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 Success -
    + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + } + + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + } + + // create path and map variables + String localVarPath = "/fake/test-query-paramters"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java new file mode 100644 index 0000000000..c7c0dcafc0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -0,0 +1,104 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class FakeClassnameTags123Api { + private ApiClient apiClient; + + public FakeClassnameTags123Api() { + this(Configuration.getDefaultApiClient()); + } + + public FakeClassnameTags123Api(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @return Client + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Client testClassname(Client body) throws ApiException { + return testClassnameWithHttpInfo(body).getData(); + } + + /** + * To test class name in snake case + * To test class name in snake case + * @param body client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + } + + // create path and map variables + String localVarPath = "/fake_classname_test"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key_query" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java new file mode 100644 index 0000000000..01476de66b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java @@ -0,0 +1,692 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class PetApi { + private ApiClient apiClient; + + public PetApi() { + this(Configuration.getDefaultApiClient()); + } + + public PetApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public void addPet(Pet body) throws ApiException { + addPetWithHttpInfo(body); + } + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    405 Invalid input -
    + */ + public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + } + + // create path and map variables + String localVarPath = "/pet"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    + */ + public void deletePet(Long petId, String apiKey) throws ApiException { + deletePetWithHttpInfo(petId, apiKey); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid pet value -
    + */ + public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + if (apiKey != null) + localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public List findPetsByStatus(List status) throws ApiException { + return findPetsByStatusWithHttpInfo(status).getData(); + } + + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid status value -
    + */ + public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); + } + + // create path and map variables + String localVarPath = "/pet/findByStatus"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public List findPetsByTags(List tags) throws ApiException { + return findPetsByTagsWithHttpInfo(tags).getData(); + } + + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid tag value -
    + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); + } + + // create path and map variables + String localVarPath = "/pet/findByTags"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public Pet getPetById(Long petId) throws ApiException { + return getPetByIdWithHttpInfo(petId).getData(); + } + + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    + */ + public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public void updatePet(Pet body) throws ApiException { + updatePetWithHttpInfo(body); + } + + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Pet not found -
    405 Validation exception -
    + */ + public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + } + + // create path and map variables + String localVarPath = "/pet"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json", "application/xml" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    405 Invalid input -
    + */ + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (name != null) + localVarFormParams.put("name", name); +if (status != null) + localVarFormParams.put("status", status); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/x-www-form-urlencoded" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { + return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData(); + } + + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + // create path and map variables + String localVarPath = "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (additionalMetadata != null) + localVarFormParams.put("additionalMetadata", additionalMetadata); +if (file != null) + localVarFormParams.put("file", file); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + } + + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + } + + // create path and map variables + String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + if (additionalMetadata != null) + localVarFormParams.put("additionalMetadata", additionalMetadata); +if (requiredFile != null) + localVarFormParams.put("requiredFile", requiredFile); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "multipart/form-data" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "petstore_auth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java new file mode 100644 index 0000000000..11496944ef --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java @@ -0,0 +1,305 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.Order; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class StoreApi { + private ApiClient apiClient; + + public StoreApi() { + this(Configuration.getDefaultApiClient()); + } + + public StoreApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public void deleteOrder(String orderId) throws ApiException { + deleteOrderWithHttpInfo(orderId); + } + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + } + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public Map getInventory() throws ApiException { + return getInventoryWithHttpInfo().getData(); + } + + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    200 successful operation -
    + */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/store/inventory"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "api_key" }; + + GenericType> localVarReturnType = new GenericType>() {}; + + return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public Order getOrderById(Long orderId) throws ApiException { + return getOrderByIdWithHttpInfo(orderId).getData(); + } + + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid ID supplied -
    404 Order not found -
    + */ + public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + // create path and map variables + String localVarPath = "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return Order + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public Order placeOrder(Order body) throws ApiException { + return placeOrderWithHttpInfo(body).getData(); + } + + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid Order -
    + */ + public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + } + + // create path and map variables + String localVarPath = "/store/order"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java new file mode 100644 index 0000000000..1f9d6afe11 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java @@ -0,0 +1,577 @@ +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; + +import javax.ws.rs.core.GenericType; + +import org.openapitools.client.model.User; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class UserApi { + private ApiClient apiClient; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUser(User body) throws ApiException { + createUserWithHttpInfo(body); + } + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUserWithHttpInfo(User body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + } + + // create path and map variables + String localVarPath = "/user"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithArrayInput(List body) throws ApiException { + createUsersWithArrayInputWithHttpInfo(body); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + } + + // create path and map variables + String localVarPath = "/user/createWithArray"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void createUsersWithListInput(List body) throws ApiException { + createUsersWithListInputWithHttpInfo(body); + } + + /** + * Creates list of users with given input array + * + * @param body List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + } + + // create path and map variables + String localVarPath = "/user/createWithList"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public void deleteUser(String username) throws ApiException { + deleteUserWithHttpInfo(username); + } + + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public User getUserByName(String username) throws ApiException { + return getUserByNameWithHttpInfo(username).getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
    Status Code Description Response Headers
    200 successful operation -
    400 Invalid username supplied -
    404 User not found -
    + */ + public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public String loginUser(String username, String password) throws ApiException { + return loginUserWithHttpInfo(username, password).getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    200 successful operation * X-Rate-Limit - calls per hour allowed by the user
    * X-Expires-After - date in UTC when token expires
    400 Invalid username/password supplied -
    + */ + public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); + } + + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); + } + + // create path and map variables + String localVarPath = "/user/login"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + + + + + final String[] localVarAccepts = { + "application/xml", "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + /** + * Logs out current logged in user session + * + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public void logoutUser() throws ApiException { + logoutUserWithHttpInfo(); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + +
    Status Code Description Response Headers
    0 successful operation -
    + */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/user/logout"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public void updateUser(String username, User body) throws ApiException { + updateUserWithHttpInfo(username, body); + } + + /** + * 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 ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
    Status Code Description Response Headers
    400 Invalid user supplied -
    404 User not found -
    + */ + public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + } + + // create path and map variables + String localVarPath = "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + + + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { }; + + return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000000..a9427105d8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -0,0 +1,77 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + + +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java new file mode 100644 index 0000000000..5c558b1d5a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java @@ -0,0 +1,30 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams); +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000000..98993417be --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -0,0 +1,58 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import com.migcomponents.migbase64.Base64; + +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + try { + headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java new file mode 100644 index 0000000000..e20259cb94 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + + +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java new file mode 100644 index 0000000000..779680c9b2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +import org.openapitools.client.Pair; + +import java.util.Map; +import java.util.List; + + +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java new file mode 100644 index 0000000000..b2d11ff0c4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -0,0 +1,18 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000000..28cf630a27 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.openapitools.client.ApiException; +import java.lang.reflect.Type; +import java.util.Map; +import javax.ws.rs.core.GenericType; + + +public abstract class AbstractOpenApiSchema { + + private Object instance; + + public final String schemaType; + + public AbstractOpenApiSchema(String schemaType) { + this.schemaType = schemaType; + } + + public abstract Map getSchemas(); + + public Object getActualInstance() {return instance;} + + public void setActualInstance(Object instance) {this.instance = instance;} + + public String getSchemaType() { + return schemaType; + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java new file mode 100644 index 0000000000..0f1223c2bc --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesAnyType + */ +@JsonPropertyOrder({ + AdditionalPropertiesAnyType.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesAnyType extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java new file mode 100644 index 0000000000..c03535ab94 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesArray + */ +@JsonPropertyOrder({ + AdditionalPropertiesArray.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesArray extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java new file mode 100644 index 0000000000..4356a4f8c1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesBoolean + */ +@JsonPropertyOrder({ + AdditionalPropertiesBoolean.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesBoolean extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java new file mode 100644 index 0000000000..781d4686e9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -0,0 +1,480 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesClass + */ +@JsonPropertyOrder({ + AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 +}) + +public class AdditionalPropertiesClass { + 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_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_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_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_ANYTYPE1 = "anytype_1"; + private Object anytype1; + + 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 AdditionalPropertiesClass mapString(Map mapString) { + + this.mapString = mapString; + 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 mapString + * @return mapString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapString() { + return mapString; + } + + + 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(); + } + this.mapNumber.put(key, mapNumberItem); + return this; + } + + /** + * Get mapNumber + * @return mapNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapNumber() { + return mapNumber; + } + + + 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(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapInteger() { + return mapInteger; + } + + + 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(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapBoolean() { + return mapBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapString() { + return mapMapString; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + + public AdditionalPropertiesClass anytype1(Object anytype1) { + + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAnytype1() { + return anytype1; + } + + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + + public AdditionalPropertiesClass anytype2(Object anytype2) { + + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAnytype2() { + return anytype2; + } + + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + + public AdditionalPropertiesClass anytype3(Object anytype3) { + + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ANYTYPE3) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Object getAnytype3() { + return anytype3; + } + + + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; + return Objects.equals(this.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java new file mode 100644 index 0000000000..2426e7c974 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesInteger + */ +@JsonPropertyOrder({ + AdditionalPropertiesInteger.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesInteger extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java new file mode 100644 index 0000000000..da407ccdc4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -0,0 +1,107 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesNumber + */ +@JsonPropertyOrder({ + AdditionalPropertiesNumber.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesNumber extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java new file mode 100644 index 0000000000..5e46887031 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesObject + */ +@JsonPropertyOrder({ + AdditionalPropertiesObject.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesObject extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java new file mode 100644 index 0000000000..ed08025496 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * AdditionalPropertiesString + */ +@JsonPropertyOrder({ + AdditionalPropertiesString.JSON_PROPERTY_NAME +}) + +public class AdditionalPropertiesString extends HashMap { + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + 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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java new file mode 100644 index 0000000000..e0ae875483 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Animal + */ +@JsonPropertyOrder({ + Animal.JSON_PROPERTY_CLASS_NAME, + Animal.JSON_PROPERTY_COLOR +}) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), +}) + +public class Animal { + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + public static final String JSON_PROPERTY_COLOR = "color"; + private String color = "red"; + + + public Animal className(String className) { + + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClassName() { + return className; + } + + + public void setClassName(String className) { + this.className = className; + } + + + public Animal color(String color) { + + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getColor() { + return color; + } + + + public void setColor(String color) { + this.color = color; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Animal animal = (Animal) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java new file mode 100644 index 0000000000..96f829bc64 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayOfArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER +}) + +public class ArrayOfArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber = null; + + + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java new file mode 100644 index 0000000000..37e40dbd3e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayOfNumberOnly + */ +@JsonPropertyOrder({ + ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER +}) + +public class ArrayOfNumberOnly { + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber = null; + + + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayNumber() { + return arrayNumber; + } + + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java new file mode 100644 index 0000000000..de7c895ac9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -0,0 +1,191 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ArrayTest + */ +@JsonPropertyOrder({ + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL +}) + +public class ArrayTest { + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger = null; + + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel = null; + + + public ArrayTest arrayOfString(List arrayOfString) { + + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayOfString() { + return arrayOfString; + } + + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java new file mode 100644 index 0000000000..84b3f05703 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java @@ -0,0 +1,145 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCat + */ +@JsonPropertyOrder({ + BigCat.JSON_PROPERTY_KIND +}) + +public class BigCat extends Cat { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String 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 kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java new file mode 100644 index 0000000000..7ce0ddb21f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * BigCatAllOf + */ +@JsonPropertyOrder({ + BigCatAllOf.JSON_PROPERTY_KIND +}) + +public class BigCatAllOf { + /** + * Gets or Sets kind + */ + public enum KindEnum { + LIONS("lions"), + + TIGERS("tigers"), + + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String 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 kind(KindEnum kind) { + + this.kind = kind; + return this; + } + + /** + * Get kind + * @return kind + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public KindEnum getKind() { + return kind; + } + + + public void setKind(KindEnum kind) { + this.kind = kind; + } + + + @Override + public boolean equals(java.lang.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java new file mode 100644 index 0000000000..033e978811 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java @@ -0,0 +1,257 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Capitalization + */ +@JsonPropertyOrder({ + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E +}) + +public class Capitalization { + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; + + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; + + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; + + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; + + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; + + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; + + + public Capitalization smallCamel(String smallCamel) { + + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallCamel() { + return smallCamel; + } + + + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; + } + + + public Capitalization capitalCamel(String capitalCamel) { + + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalCamel() { + return capitalCamel; + } + + + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + + public Capitalization smallSnake(String smallSnake) { + + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSmallSnake() { + return smallSnake; + } + + + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + + public Capitalization capitalSnake(String capitalSnake) { + + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCapitalSnake() { + return capitalSnake; + } + + + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + + public Capitalization ATT_NAME(String ATT_NAME) { + + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Name of the pet ") + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getATTNAME() { + return ATT_NAME; + } + + + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java new file mode 100644 index 0000000000..484725c76f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Cat + */ +@JsonPropertyOrder({ + Cat.JSON_PROPERTY_DECLAWED +}) + +public class Cat extends Animal { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + + public Cat declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java new file mode 100644 index 0000000000..3e7b991436 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * CatAllOf + */ +@JsonPropertyOrder({ + CatAllOf.JSON_PROPERTY_DECLAWED +}) + +public class CatAllOf { + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; + + + public CatAllOf declawed(Boolean declawed) { + + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeclawed() { + return declawed; + } + + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java new file mode 100644 index 0000000000..868ba87507 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java @@ -0,0 +1,132 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Category + */ +@JsonPropertyOrder({ + Category.JSON_PROPERTY_ID, + Category.JSON_PROPERTY_NAME +}) + +public class Category { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; + + + public Category id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Category name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java new file mode 100644 index 0000000000..4de7664b26 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model with \"_class\" property + */ +@ApiModel(description = "Model for testing model with \"_class\" property") +@JsonPropertyOrder({ + ClassModel.JSON_PROPERTY_PROPERTY_CLASS +}) + +public class ClassModel { + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; + + + public ClassModel propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java new file mode 100644 index 0000000000..02b0aac224 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Client + */ +@JsonPropertyOrder({ + Client.JSON_PROPERTY_CLIENT +}) + +public class Client { + public static final String JSON_PROPERTY_CLIENT = "client"; + private String client; + + + public Client client(String client) { + + this.client = client; + return this; + } + + /** + * Get client + * @return client + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getClient() { + return client; + } + + + public void setClient(String client) { + this.client = client; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java new file mode 100644 index 0000000000..78044654d5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java @@ -0,0 +1,106 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Dog + */ +@JsonPropertyOrder({ + Dog.JSON_PROPERTY_BREED +}) + +public class Dog extends Animal { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + + public Dog breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java new file mode 100644 index 0000000000..dd42595cf2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * DogAllOf + */ +@JsonPropertyOrder({ + DogAllOf.JSON_PROPERTY_BREED +}) + +public class DogAllOf { + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; + + + public DogAllOf breed(String breed) { + + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBreed() { + return breed; + } + + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java new file mode 100644 index 0000000000..aff182cd49 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -0,0 +1,213 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EnumArrays + */ +@JsonPropertyOrder({ + EnumArrays.JSON_PROPERTY_JUST_SYMBOL, + EnumArrays.JSON_PROPERTY_ARRAY_ENUM +}) + +public class EnumArrays { + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum = null; + + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + + public EnumArrays arrayEnum(List arrayEnum) { + + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getArrayEnum() { + return arrayEnum; + } + + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArrays enumArrays = (EnumArrays) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java new file mode 100644 index 0000000000..e9102d9742 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ +public enum EnumClass { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumClass(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java new file mode 100644 index 0000000000..51a1a645a1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java @@ -0,0 +1,370 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.OuterEnum; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * EnumTest + */ +@JsonPropertyOrder({ + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM +}) + +public class EnumTest { + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; + + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private OuterEnum outerEnum; + + + public EnumTest enumString(EnumStringEnum enumString) { + + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumStringEnum getEnumString() { + return enumString; + } + + + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + + + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + + public EnumTest outerEnum(OuterEnum outerEnum) { + + this.outerEnum = outerEnum; + return this; + } + + /** + * Get outerEnum + * @return outerEnum + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OuterEnum getOuterEnum() { + return outerEnum; + } + + + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = outerEnum; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTest enumTest = (EnumTest) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + Objects.equals(this.outerEnum, enumTest.outerEnum); + } + + @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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java new file mode 100644 index 0000000000..8166597792 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * FileSchemaTestClass + */ +@JsonPropertyOrder({ + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES +}) + +public class FileSchemaTestClass { + public static final String JSON_PROPERTY_FILE = "file"; + private java.io.File file; + + public static final String JSON_PROPERTY_FILES = "files"; + private List files = null; + + + public FileSchemaTestClass file(java.io.File file) { + + this.file = file; + return this; + } + + /** + * Get file + * @return file + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public java.io.File getFile() { + return file; + } + + + public void setFile(java.io.File file) { + this.file = file; + } + + + public FileSchemaTestClass files(List files) { + + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(java.io.File filesItem) { + if (this.files == null) { + this.files = new ArrayList(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getFiles() { + return files; + } + + + public void setFiles(List files) { + this.files = files; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java new file mode 100644 index 0000000000..4dee7f6c9d --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java @@ -0,0 +1,516 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * FormatTest + */ +@JsonPropertyOrder({ + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_BIG_DECIMAL +}) + +public class FormatTest { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_BIG_DECIMAL = "BigDecimal"; + private BigDecimal bigDecimal; + + + public FormatTest integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInteger() { + return integer; + } + + + public void setInteger(Integer integer) { + this.integer = integer; + } + + + public FormatTest int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInt32() { + return int32; + } + + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + + public FormatTest int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getInt64() { + return int64; + } + + + public void setInt64(Long int64) { + this.int64 = int64; + } + + + public FormatTest number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumber() { + return number; + } + + + public void setNumber(BigDecimal number) { + this.number = number; + } + + + public FormatTest _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Float getFloat() { + return _float; + } + + + public void setFloat(Float _float) { + this._float = _float; + } + + + public FormatTest _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getDouble() { + return _double; + } + + + public void setDouble(Double _double) { + this._double = _double; + } + + + public FormatTest string(String string) { + + this.string = string; + return this; + } + + /** + * Get string + * @return string + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getString() { + return string; + } + + + public void setString(String string) { + this.string = string; + } + + + public FormatTest _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public byte[] getByte() { + return _byte; + } + + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + + public FormatTest binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public File getBinary() { + return binary; + } + + + public void setBinary(File binary) { + this.binary = binary; + } + + + public FormatTest date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * Get date + * @return date + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LocalDate getDate() { + return date; + } + + + public void setDate(LocalDate date) { + this.date = date; + } + + + public FormatTest dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public FormatTest uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public FormatTest password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public FormatTest bigDecimal(BigDecimal bigDecimal) { + + this.bigDecimal = bigDecimal; + return this; + } + + /** + * Get bigDecimal + * @return bigDecimal + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getBigDecimal() { + return bigDecimal; + } + + + public void setBigDecimal(BigDecimal bigDecimal) { + this.bigDecimal = bigDecimal; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTest formatTest = (FormatTest) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java new file mode 100644 index 0000000000..0a3f0d4643 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -0,0 +1,115 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * HasOnlyReadOnly + */ +@JsonPropertyOrder({ + HasOnlyReadOnly.JSON_PROPERTY_BAR, + HasOnlyReadOnly.JSON_PROPERTY_FOO +}) + +public class HasOnlyReadOnly { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; + + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + + /** + * Get foo + * @return foo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFoo() { + return foo; + } + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java new file mode 100644 index 0000000000..113f92dd9c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java @@ -0,0 +1,265 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MapTest + */ +@JsonPropertyOrder({ + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP +}) + +public class MapTest { + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString = null; + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString = null; + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap = null; + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap = null; + + + public MapTest mapMapOfString(Map> mapMapOfString) { + + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map> getMapMapOfString() { + return mapMapOfString; + } + + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + + public MapTest mapOfEnumString(Map mapOfEnumString) { + + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + + public MapTest directMap(Map directMap) { + + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getDirectMap() { + return directMap; + } + + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + + public MapTest indirectMap(Map indirectMap) { + + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getIndirectMap() { + return indirectMap; + } + + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTest mapTest = (MapTest) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java new file mode 100644 index 0000000000..d483d69700 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -0,0 +1,178 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * MixedPropertiesAndAdditionalPropertiesClass + */ +@JsonPropertyOrder({ + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP +}) + +public class MixedPropertiesAndAdditionalPropertiesClass { + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_MAP = "map"; + private Map map = null; + + + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public UUID getUuid() { + return uuid; + } + + + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getDateTime() { + return dateTime; + } + + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Map getMap() { + return map; + } + + + public void setMap(Map map) { + this.map = map; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java new file mode 100644 index 0000000000..dd99468a00 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java @@ -0,0 +1,134 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model name starting with number + */ +@ApiModel(description = "Model for testing model name starting with number") +@JsonPropertyOrder({ + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS +}) + +public class Model200Response { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; + + + public Model200Response name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + public Model200Response propertyClass(String propertyClass) { + + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPropertyClass() { + return propertyClass; + } + + + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200Response _200response = (Model200Response) o; + return Objects.equals(this.name, _200response.name) && + Objects.equals(this.propertyClass, _200response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java new file mode 100644 index 0000000000..383cafdd3a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -0,0 +1,164 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ModelApiResponse + */ +@JsonPropertyOrder({ + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE +}) + +public class ModelApiResponse { + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + + public ModelApiResponse code(Integer code) { + + this.code = code; + return this; + } + + /** + * Get code + * @return code + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCode() { + return code; + } + + + public void setCode(Integer code) { + this.code = code; + } + + + public ModelApiResponse type(String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + public ModelApiResponse message(String message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMessage() { + return message; + } + + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelApiResponse _apiResponse = (ModelApiResponse) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java new file mode 100644 index 0000000000..b62e13a90a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing reserved words + */ +@ApiModel(description = "Model for testing reserved words") +@JsonPropertyOrder({ + ModelReturn.JSON_PROPERTY_RETURN +}) + +public class ModelReturn { + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; + + + public ModelReturn _return(Integer _return) { + + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getReturn() { + return _return; + } + + + public void setReturn(Integer _return) { + this._return = _return; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelReturn _return = (ModelReturn) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java new file mode 100644 index 0000000000..bd625c5f66 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Model for testing model name same as property name + */ +@ApiModel(description = "Model for testing model name same as property name") +@JsonPropertyOrder({ + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER +}) + +public class Name { + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; + + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; + + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; + + + public Name name(Integer name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getName() { + return name; + } + + + public void setName(Integer name) { + this.name = name; + } + + + /** + * Get snakeCase + * @return snakeCase + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getSnakeCase() { + return snakeCase; + } + + + + + public Name property(String property) { + + this.property = property; + return this; + } + + /** + * Get property + * @return property + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getProperty() { + return property; + } + + + public void setProperty(String property) { + this.property = property; + } + + + /** + * Get _123number + * @return _123number + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer get123number() { + return _123number; + } + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123number, name._123number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java new file mode 100644 index 0000000000..5ca72a169f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * NumberOnly + */ +@JsonPropertyOrder({ + NumberOnly.JSON_PROPERTY_JUST_NUMBER +}) + +public class NumberOnly { + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; + + + public NumberOnly justNumber(BigDecimal justNumber) { + + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getJustNumber() { + return justNumber; + } + + + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnly numberOnly = (NumberOnly) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java new file mode 100644 index 0000000000..6e28163021 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java @@ -0,0 +1,295 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.threeten.bp.OffsetDateTime; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Order + */ +@JsonPropertyOrder({ + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE +}) + +public class Order { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; + + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + + public Order id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Order petId(Long petId) { + + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getPetId() { + return petId; + } + + + public void setPetId(Long petId) { + this.petId = petId; + } + + + public Order quantity(Integer quantity) { + + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getQuantity() { + return quantity; + } + + + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + + public Order shipDate(OffsetDateTime shipDate) { + + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public OffsetDateTime getShipDate() { + return shipDate; + } + + + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + + public Order status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Order Status + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Order Status") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public Order complete(Boolean complete) { + + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getComplete() { + return complete; + } + + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Order order = (Order) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java new file mode 100644 index 0000000000..d4d9ac6ba1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -0,0 +1,165 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * OuterComposite + */ +@JsonPropertyOrder({ + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN +}) + +public class OuterComposite { + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; + + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; + + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; + + + public OuterComposite myNumber(BigDecimal myNumber) { + + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getMyNumber() { + return myNumber; + } + + + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + } + + + public OuterComposite myString(String myString) { + + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMyString() { + return myString; + } + + + public void setMyString(String myString) { + this.myString = myString; + } + + + public OuterComposite myBoolean(Boolean myBoolean) { + + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getMyBoolean() { + return myBoolean; + } + + + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterComposite outerComposite = (OuterComposite) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java new file mode 100644 index 0000000000..308646a320 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -0,0 +1,60 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ +public enum OuterEnum { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java new file mode 100644 index 0000000000..be74dd5ca0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java @@ -0,0 +1,309 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Pet + */ +@JsonPropertyOrder({ + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS +}) + +public class Pet { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private List photoUrls = new ArrayList(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + + public Pet id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Pet category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Category getCategory() { + return category; + } + + + public void setCategory(Category category) { + this.category = category; + } + + + public Pet name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Pet photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getPhotoUrls() { + return photoUrls; + } + + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public Pet tags(List tags) { + + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public Pet status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pet pet = (Pet) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java new file mode 100644 index 0000000000..b3e58ef3d2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * ReadOnlyFirst + */ +@JsonPropertyOrder({ + ReadOnlyFirst.JSON_PROPERTY_BAR, + ReadOnlyFirst.JSON_PROPERTY_BAZ +}) + +public class ReadOnlyFirst { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; + + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; + + + /** + * Get bar + * @return bar + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBar() { + return bar; + } + + + + + public ReadOnlyFirst baz(String baz) { + + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getBaz() { + return baz; + } + + + public void setBaz(String baz) { + this.baz = baz; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java new file mode 100644 index 0000000000..35ad3bf469 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -0,0 +1,102 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * SpecialModelName + */ +@JsonPropertyOrder({ + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME +}) + +public class SpecialModelName { + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; + + + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + + this.$specialPropertyName = $specialPropertyName; + return this; + } + + /** + * Get $specialPropertyName + * @return $specialPropertyName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + + + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelName $specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java new file mode 100644 index 0000000000..a3ecb398fa --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Tag + */ +@JsonPropertyOrder({ + Tag.JSON_PROPERTY_ID, + Tag.JSON_PROPERTY_NAME +}) + +public class Tag { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + + public Tag id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public Tag name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Tag tag = (Tag) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java new file mode 100644 index 0000000000..73f3935879 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -0,0 +1,229 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TypeHolderDefault + */ +@JsonPropertyOrder({ + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM +}) + +public class TypeHolderDefault { + 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_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_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList(); + + + public TypeHolderDefault stringItem(String stringItem) { + + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStringItem() { + return stringItem; + } + + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumberItem() { + return numberItem; + } + + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + + public TypeHolderDefault integerItem(Integer integerItem) { + + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getIntegerItem() { + return integerItem; + } + + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + + public TypeHolderDefault boolItem(Boolean boolItem) { + + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getBoolItem() { + return boolItem; + } + + + 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 + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getArrayItem() { + return arrayItem; + } + + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java new file mode 100644 index 0000000000..e3daa1a3e1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -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: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * TypeHolderExample + */ +@JsonPropertyOrder({ + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM +}) + +public class TypeHolderExample { + 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_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_BOOL_ITEM = "bool_item"; + private Boolean boolItem; + + 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 + **/ + @ApiModelProperty(example = "what", required = true, value = "") + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStringItem() { + return stringItem; + } + + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + + public TypeHolderExample numberItem(BigDecimal numberItem) { + + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public BigDecimal getNumberItem() { + return numberItem; + } + + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + + public TypeHolderExample floatItem(Float floatItem) { + + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * @return floatItem + **/ + @ApiModelProperty(example = "1.234", required = true, value = "") + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Float getFloatItem() { + return floatItem; + } + + + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + + public TypeHolderExample integerItem(Integer integerItem) { + + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @ApiModelProperty(example = "-2", required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getIntegerItem() { + return integerItem; + } + + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + + public TypeHolderExample boolItem(Boolean boolItem) { + + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @ApiModelProperty(example = "true", required = true, value = "") + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getBoolItem() { + return boolItem; + } + + + 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 + **/ + @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getArrayItem() { + return arrayItem; + } + + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java new file mode 100644 index 0000000000..b7e74643da --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java @@ -0,0 +1,319 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * User + */ +@JsonPropertyOrder({ + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS +}) + +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 id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public User username(String username) { + + this.username = username; + return this; + } + + /** + * Get username + * @return username + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public User firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public User lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + public User email(String email) { + + this.email = email; + return this; + } + + /** + * Get email + * @return email + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public User password(String password) { + + this.password = password; + return this; + } + + /** + * Get password + * @return password + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public User phone(String phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPhone() { + return phone; + } + + + public void setPhone(String phone) { + this.phone = phone; + } + + + public User userStatus(Integer userStatus) { + + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "User Status") + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getUserStatus() { + return userStatus; + } + + + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + User user = (User) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java new file mode 100644 index 0000000000..f585a62522 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java @@ -0,0 +1,1045 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * XmlItem + */ +@JsonPropertyOrder({ + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY +}) + +public class XmlItem { + 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_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_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_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_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_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_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_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_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_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_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_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_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_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_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + private List prefixNsWrappedArray = null; + + + public XmlItem attributeString(String attributeString) { + + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAttributeString() { + return attributeString; + } + + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + + public XmlItem attributeInteger(Integer attributeInteger) { + + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getAttributeInteger() { + return attributeInteger; + } + + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getWrappedArray() { + return wrappedArray; + } + + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + + public XmlItem nameString(String nameString) { + + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNameString() { + return nameString; + } + + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + + public XmlItem nameNumber(BigDecimal nameNumber) { + + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getNameNumber() { + return nameNumber; + } + + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + + public XmlItem nameInteger(Integer nameInteger) { + + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNameInteger() { + return nameInteger; + } + + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + + public XmlItem nameBoolean(Boolean nameBoolean) { + + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getNameBoolean() { + return nameBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNameArray() { + return nameArray; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNameWrappedArray() { + return nameWrappedArray; + } + + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + + public XmlItem prefixString(String prefixString) { + + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrefixString() { + return prefixString; + } + + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + + public XmlItem prefixInteger(Integer prefixInteger) { + + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPrefixInteger() { + return prefixInteger; + } + + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPrefixArray() { + return prefixArray; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + + public XmlItem namespaceString(String namespaceString) { + + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNamespaceString() { + return namespaceString; + } + + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + + public XmlItem namespaceInteger(Integer namespaceInteger) { + + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNamespaceArray() { + return namespaceArray; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + + public XmlItem prefixNsString(String prefixNsString) { + + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "string", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPrefixNsString() { + return prefixNsString; + } + + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "1.234", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "-2", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPrefixNsArray() { + return prefixNsArray; + } + + + 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 + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.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(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java new file mode 100644 index 0000000000..837b5ea024 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for AnotherFakeApi + */ +@Ignore +public class AnotherFakeApiTest { + + private final AnotherFakeApi api = new AnotherFakeApi(); + + + /** + * To test special tags + * + * To test special tags and operation ID starting with number + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + Client body = null; + Client response = api.call123testSpecialTags(body); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java new file mode 100644 index 0000000000..b2c8f47fb3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -0,0 +1,291 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.math.BigDecimal; +import org.openapitools.client.model.Client; +import java.io.File; +import org.openapitools.client.model.FileSchemaTestClass; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.User; +import org.openapitools.client.model.XmlItem; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeApi + */ +@Ignore +public class FakeApiTest { + + private final FakeApi api = new FakeApi(); + + + /** + * creates an XmlItem + * + * this route creates an XmlItem + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createXmlItemTest() throws ApiException { + XmlItem xmlItem = null; + api.createXmlItem(xmlItem); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer boolean types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of object with outer number type + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + OuterComposite body = null; + OuterComposite response = api.fakeOuterCompositeSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer number types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); + // TODO: test validations + } + + /** + * + * + * Test serialization of outer string types + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); + // TODO: test validations + } + + /** + * + * + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + FileSchemaTestClass body = null; + api.testBodyWithFileSchema(body); + // TODO: test validations + } + + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + String query = null; + User body = null; + api.testBodyWithQueryParams(query, body); + // TODO: test validations + } + + /** + * To test \"client\" model + * + * To test \"client\" model + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + Client body = null; + Client response = api.testClientModel(body); + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws ApiException { + BigDecimal number = null; + Double _double = null; + String patternWithoutDelimiter = null; + byte[] _byte = null; + Integer integer = null; + Integer int32 = null; + Long int64 = null; + Float _float = null; + String string = null; + File binary = null; + LocalDate date = null; + OffsetDateTime dateTime = null; + String password = null; + String paramCallback = null; + api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; + Integer enumQueryInteger = null; + Double enumQueryDouble = null; + List enumFormStringArray = null; + String enumFormString = null; + api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + * Fake endpoint to test group parameters (optional) + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + Integer requiredStringGroup = null; + Boolean requiredBooleanGroup = null; + Long requiredInt64Group = null; + Integer stringGroup = null; + Boolean booleanGroup = null; + Long int64Group = null; + api.testGroupParameters() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .execute(); + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + Map param = null; + api.testInlineAdditionalProperties(param); + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + String param = null; + String param2 = null; + api.testJsonFormData(param, param2); + // TODO: test validations + } + + /** + * + * + * To test the collection format in query parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + List pipe = null; + List ioutil = null; + List http = null; + List url = null; + List context = null; + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java new file mode 100644 index 0000000000..7199931679 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for FakeClassnameTags123Api + */ +@Ignore +public class FakeClassnameTags123ApiTest { + + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + + + /** + * To test class name in snake case + * + * To test class name in snake case + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + Client body = null; + Client response = api.testClassname(body); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java new file mode 100644 index 0000000000..fd382967f1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -0,0 +1,179 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import java.io.File; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for PetApi + */ +@Ignore +public class PetApiTest { + + private final PetApi api = new PetApi(); + + + /** + * Add a new pet to the store + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + Pet body = null; + api.addPet(body); + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + Long petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); + // TODO: test validations + } + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); + // TODO: test validations + } + + /** + * Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + Long petId = null; + Pet response = api.getPetById(petId); + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + Pet body = null; + api.updatePet(body); + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + Long petId = null; + String name = null; + String status = null; + api.updatePetWithForm(petId, name, status); + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + Long petId = null; + String additionalMetadata = null; + File file = null; + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + // TODO: test validations + } + + /** + * uploads an image (required) + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws ApiException { + Long petId = null; + File requiredFile = null; + String additionalMetadata = null; + ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java new file mode 100644 index 0000000000..cd36a70fec --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -0,0 +1,94 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Order; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for StoreApi + */ +@Ignore +public class StoreApiTest { + + private final StoreApi api = new StoreApi(); + + + /** + * Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); + // TODO: test validations + } + + /** + * Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + Long orderId = null; + Order response = api.getOrderById(orderId); + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + Order body = null; + Order response = api.placeOrder(body); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java new file mode 100644 index 0000000000..f7ef9050c9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -0,0 +1,156 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.api; + +import org.openapitools.client.ApiException; +import org.openapitools.client.model.User; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for UserApi + */ +@Ignore +public class UserApiTest { + + private final UserApi api = new UserApi(); + + + /** + * Create user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + User body = null; + api.createUser(body); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + List body = null; + api.createUsersWithArrayInput(body); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + List body = null; + api.createUsersWithListInput(body); + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + api.logoutUser(); + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + String username = null; + User body = null; + api.updateUser(username, body); + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java new file mode 100644 index 0000000000..ec44af7838 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesAnyType + */ +public class AdditionalPropertiesAnyTypeTest { + private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); + + /** + * Model tests for AdditionalPropertiesAnyType + */ + @Test + public void testAdditionalPropertiesAnyType() { + // TODO: test AdditionalPropertiesAnyType + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java new file mode 100644 index 0000000000..ceb024c562 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesArray + */ +public class AdditionalPropertiesArrayTest { + private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); + + /** + * Model tests for AdditionalPropertiesArray + */ + @Test + public void testAdditionalPropertiesArray() { + // TODO: test AdditionalPropertiesArray + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java new file mode 100644 index 0000000000..517e5a10ae --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesBoolean + */ +public class AdditionalPropertiesBooleanTest { + private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); + + /** + * Model tests for AdditionalPropertiesBoolean + */ + @Test + public void testAdditionalPropertiesBoolean() { + // TODO: test AdditionalPropertiesBoolean + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java new file mode 100644 index 0000000000..2e3844ba97 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -0,0 +1,133 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesClass + */ +public class AdditionalPropertiesClassTest { + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + + /** + * Model tests for AdditionalPropertiesClass + */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } + + /** + * Test the property 'mapString' + */ + @Test + public void mapStringTest() { + // TODO: test mapString + } + + /** + * Test the property 'mapNumber' + */ + @Test + public void mapNumberTest() { + // TODO: test mapNumber + } + + /** + * Test the property 'mapInteger' + */ + @Test + public void mapIntegerTest() { + // TODO: test mapInteger + } + + /** + * Test the property 'mapBoolean' + */ + @Test + public void mapBooleanTest() { + // TODO: test mapBoolean + } + + /** + * Test the property 'mapArrayInteger' + */ + @Test + public void mapArrayIntegerTest() { + // TODO: test mapArrayInteger + } + + /** + * Test the property 'mapArrayAnytype' + */ + @Test + public void mapArrayAnytypeTest() { + // TODO: test mapArrayAnytype + } + + /** + * Test the property 'mapMapString' + */ + @Test + public void mapMapStringTest() { + // TODO: test mapMapString + } + + /** + * Test the property 'mapMapAnytype' + */ + @Test + public void mapMapAnytypeTest() { + // TODO: test mapMapAnytype + } + + /** + * Test the property 'anytype1' + */ + @Test + public void anytype1Test() { + // TODO: test anytype1 + } + + /** + * Test the property 'anytype2' + */ + @Test + public void anytype2Test() { + // TODO: test anytype2 + } + + /** + * Test the property 'anytype3' + */ + @Test + public void anytype3Test() { + // TODO: test anytype3 + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java new file mode 100644 index 0000000000..66a7b85623 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesInteger + */ +public class AdditionalPropertiesIntegerTest { + private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); + + /** + * Model tests for AdditionalPropertiesInteger + */ + @Test + public void testAdditionalPropertiesInteger() { + // TODO: test AdditionalPropertiesInteger + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java new file mode 100644 index 0000000000..4e03485a44 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesNumber + */ +public class AdditionalPropertiesNumberTest { + private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); + + /** + * Model tests for AdditionalPropertiesNumber + */ + @Test + public void testAdditionalPropertiesNumber() { + // TODO: test AdditionalPropertiesNumber + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java new file mode 100644 index 0000000000..e0c72c5863 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesObject + */ +public class AdditionalPropertiesObjectTest { + private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); + + /** + * Model tests for AdditionalPropertiesObject + */ + @Test + public void testAdditionalPropertiesObject() { + // TODO: test AdditionalPropertiesObject + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java new file mode 100644 index 0000000000..c84d987e76 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for AdditionalPropertiesString + */ +public class AdditionalPropertiesStringTest { + private final AdditionalPropertiesString model = new AdditionalPropertiesString(); + + /** + * Model tests for AdditionalPropertiesString + */ + @Test + public void testAdditionalPropertiesString() { + // TODO: test AdditionalPropertiesString + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java new file mode 100644 index 0000000000..c0d10ec5a3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Animal + */ +public class AnimalTest { + private final Animal model = new Animal(); + + /** + * Model tests for Animal + */ + @Test + public void testAnimal() { + // TODO: test Animal + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java new file mode 100644 index 0000000000..e25187a3b6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfArrayOfNumberOnly + */ +public class ArrayOfArrayOfNumberOnlyTest { + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfArrayOfNumberOnly + */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + + /** + * Test the property 'arrayArrayNumber' + */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java new file mode 100644 index 0000000000..ae10618239 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayOfNumberOnly + */ +public class ArrayOfNumberOnlyTest { + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + + /** + * Model tests for ArrayOfNumberOnly + */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + + /** + * Test the property 'arrayNumber' + */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java new file mode 100644 index 0000000000..36bd9951cf --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -0,0 +1,68 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.ReadOnlyFirst; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ArrayTest + */ +public class ArrayTestTest { + private final ArrayTest model = new ArrayTest(); + + /** + * Model tests for ArrayTest + */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } + + /** + * Test the property 'arrayOfString' + */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } + + /** + * Test the property 'arrayArrayOfInteger' + */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + + /** + * Test the property 'arrayArrayOfModel' + */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java new file mode 100644 index 0000000000..a9b13011f0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCatAllOf + */ +public class BigCatAllOfTest { + private final BigCatAllOf model = new BigCatAllOf(); + + /** + * Model tests for BigCatAllOf + */ + @Test + public void testBigCatAllOf() { + // TODO: test BigCatAllOf + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java new file mode 100644 index 0000000000..006c807074 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.BigCatAllOf; +import org.openapitools.client.model.Cat; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for BigCat + */ +public class BigCatTest { + private final BigCat model = new BigCat(); + + /** + * Model tests for BigCat + */ + @Test + public void testBigCat() { + // TODO: test BigCat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + + /** + * Test the property 'kind' + */ + @Test + public void kindTest() { + // TODO: test kind + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java new file mode 100644 index 0000000000..a701b341fc --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -0,0 +1,89 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Capitalization + */ +public class CapitalizationTest { + private final Capitalization model = new Capitalization(); + + /** + * Model tests for Capitalization + */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } + + /** + * Test the property 'smallCamel' + */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } + + /** + * Test the property 'capitalCamel' + */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } + + /** + * Test the property 'smallSnake' + */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } + + /** + * Test the property 'capitalSnake' + */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } + + /** + * Test the property 'scAETHFlowPoints' + */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + + /** + * Test the property 'ATT_NAME' + */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java new file mode 100644 index 0000000000..1d85a04472 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for CatAllOf + */ +public class CatAllOfTest { + private final CatAllOf model = new CatAllOf(); + + /** + * Model tests for CatAllOf + */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java new file mode 100644 index 0000000000..dbf40678a2 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.CatAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Cat + */ +public class CatTest { + private final Cat model = new Cat(); + + /** + * Model tests for Cat + */ + @Test + public void testCat() { + // TODO: test Cat + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'declawed' + */ + @Test + public void declawedTest() { + // TODO: test declawed + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java new file mode 100644 index 0000000000..6027994a2a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Category + */ +public class CategoryTest { + private final Category model = new Category(); + + /** + * Model tests for Category + */ + @Test + public void testCategory() { + // TODO: test Category + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java new file mode 100644 index 0000000000..8914c9cad4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ClassModel + */ +public class ClassModelTest { + private final ClassModel model = new ClassModel(); + + /** + * Model tests for ClassModel + */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java new file mode 100644 index 0000000000..c21b346272 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Client + */ +public class ClientTest { + private final Client model = new Client(); + + /** + * Model tests for Client + */ + @Test + public void testClient() { + // TODO: test Client + } + + /** + * Test the property 'client' + */ + @Test + public void clientTest() { + // TODO: test client + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java new file mode 100644 index 0000000000..6e4b491080 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for DogAllOf + */ +public class DogAllOfTest { + private final DogAllOf model = new DogAllOf(); + + /** + * Model tests for DogAllOf + */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java new file mode 100644 index 0000000000..a46bc508d4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java @@ -0,0 +1,67 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.Animal; +import org.openapitools.client.model.DogAllOf; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Dog + */ +public class DogTest { + private final Dog model = new Dog(); + + /** + * Model tests for Dog + */ + @Test + public void testDog() { + // TODO: test Dog + } + + /** + * Test the property 'className' + */ + @Test + public void classNameTest() { + // TODO: test className + } + + /** + * Test the property 'color' + */ + @Test + public void colorTest() { + // TODO: test color + } + + /** + * Test the property 'breed' + */ + @Test + public void breedTest() { + // TODO: test breed + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java new file mode 100644 index 0000000000..45b8fbbd82 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumArrays + */ +public class EnumArraysTest { + private final EnumArrays model = new EnumArrays(); + + /** + * Model tests for EnumArrays + */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } + + /** + * Test the property 'justSymbol' + */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + + /** + * Test the property 'arrayEnum' + */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java new file mode 100644 index 0000000000..9e45543fac --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumClass + */ +public class EnumClassTest { + /** + * Model tests for EnumClass + */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java new file mode 100644 index 0000000000..04e7afb197 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -0,0 +1,82 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.client.model.OuterEnum; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for EnumTest + */ +public class EnumTestTest { + private final EnumTest model = new EnumTest(); + + /** + * Model tests for EnumTest + */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } + + /** + * Test the property 'enumString' + */ + @Test + public void enumStringTest() { + // TODO: test enumString + } + + /** + * Test the property 'enumStringRequired' + */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } + + /** + * Test the property 'enumInteger' + */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } + + /** + * Test the property 'enumNumber' + */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } + + /** + * Test the property 'outerEnum' + */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java new file mode 100644 index 0000000000..ef37e666be --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -0,0 +1,59 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FileSchemaTestClass + */ +public class FileSchemaTestClassTest { + private final FileSchemaTestClass model = new FileSchemaTestClass(); + + /** + * Model tests for FileSchemaTestClass + */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } + + /** + * Test the property 'file' + */ + @Test + public void fileTest() { + // TODO: test file + } + + /** + * Test the property 'files' + */ + @Test + public void filesTest() { + // TODO: test files + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java new file mode 100644 index 0000000000..710501b51b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -0,0 +1,158 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.util.UUID; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for FormatTest + */ +public class FormatTestTest { + private final FormatTest model = new FormatTest(); + + /** + * Model tests for FormatTest + */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } + + /** + * Test the property 'integer' + */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** + * Test the property 'int32' + */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** + * Test the property 'int64' + */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** + * Test the property 'number' + */ + @Test + public void numberTest() { + // TODO: test number + } + + /** + * Test the property '_float' + */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** + * Test the property '_double' + */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** + * Test the property 'string' + */ + @Test + public void stringTest() { + // TODO: test string + } + + /** + * Test the property '_byte' + */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** + * Test the property 'binary' + */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** + * Test the property 'date' + */ + @Test + public void dateTest() { + // TODO: test date + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'bigDecimal' + */ + @Test + public void bigDecimalTest() { + // TODO: test bigDecimal + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java new file mode 100644 index 0000000000..e902c10038 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for HasOnlyReadOnly + */ +public class HasOnlyReadOnlyTest { + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + + /** + * Model tests for HasOnlyReadOnly + */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'foo' + */ + @Test + public void fooTest() { + // TODO: test foo + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java new file mode 100644 index 0000000000..a0c991bb75 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -0,0 +1,76 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MapTest + */ +public class MapTestTest { + private final MapTest model = new MapTest(); + + /** + * Model tests for MapTest + */ + @Test + public void testMapTest() { + // TODO: test MapTest + } + + /** + * Test the property 'mapMapOfString' + */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } + + /** + * Test the property 'mapOfEnumString' + */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } + + /** + * Test the property 'directMap' + */ + @Test + public void directMapTest() { + // TODO: test directMap + } + + /** + * Test the property 'indirectMap' + */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java new file mode 100644 index 0000000000..f8a8c734ba --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -0,0 +1,71 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import org.openapitools.client.model.Animal; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ +public class MixedPropertiesAndAdditionalPropertiesClassTest { + private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + + /** + * Model tests for MixedPropertiesAndAdditionalPropertiesClass + */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } + + /** + * Test the property 'uuid' + */ + @Test + public void uuidTest() { + // TODO: test uuid + } + + /** + * Test the property 'dateTime' + */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** + * Test the property 'map' + */ + @Test + public void mapTest() { + // TODO: test map + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java new file mode 100644 index 0000000000..82c7208079 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Model200Response + */ +public class Model200ResponseTest { + private final Model200Response model = new Model200Response(); + + /** + * Model tests for Model200Response + */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'propertyClass' + */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java new file mode 100644 index 0000000000..97a1287aa4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -0,0 +1,65 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelApiResponse + */ +public class ModelApiResponseTest { + private final ModelApiResponse model = new ModelApiResponse(); + + /** + * Model tests for ModelApiResponse + */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } + + /** + * Test the property 'code' + */ + @Test + public void codeTest() { + // TODO: test code + } + + /** + * Test the property 'type' + */ + @Test + public void typeTest() { + // TODO: test type + } + + /** + * Test the property 'message' + */ + @Test + public void messageTest() { + // TODO: test message + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java new file mode 100644 index 0000000000..f884519ebc --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelReturn + */ +public class ModelReturnTest { + private final ModelReturn model = new ModelReturn(); + + /** + * Model tests for ModelReturn + */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + + /** + * Test the property '_return' + */ + @Test + public void _returnTest() { + // TODO: test _return + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java new file mode 100644 index 0000000000..cb3a94cf74 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java @@ -0,0 +1,73 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Name + */ +public class NameTest { + private final Name model = new Name(); + + /** + * Model tests for Name + */ + @Test + public void testName() { + // TODO: test Name + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'snakeCase' + */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } + + /** + * Test the property 'property' + */ + @Test + public void propertyTest() { + // TODO: test property + } + + /** + * Test the property '_123number' + */ + @Test + public void _123numberTest() { + // TODO: test _123number + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java new file mode 100644 index 0000000000..f4fbd5ee8b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for NumberOnly + */ +public class NumberOnlyTest { + private final NumberOnly model = new NumberOnly(); + + /** + * Model tests for NumberOnly + */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + + /** + * Test the property 'justNumber' + */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java new file mode 100644 index 0000000000..d24c8479f5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java @@ -0,0 +1,90 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.threeten.bp.OffsetDateTime; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Order + */ +public class OrderTest { + private final Order model = new Order(); + + /** + * Model tests for Order + */ + @Test + public void testOrder() { + // TODO: test Order + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'petId' + */ + @Test + public void petIdTest() { + // TODO: test petId + } + + /** + * Test the property 'quantity' + */ + @Test + public void quantityTest() { + // TODO: test quantity + } + + /** + * Test the property 'shipDate' + */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + + /** + * Test the property 'complete' + */ + @Test + public void completeTest() { + // TODO: test complete + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java new file mode 100644 index 0000000000..ebea3ca304 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -0,0 +1,66 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterComposite + */ +public class OuterCompositeTest { + private final OuterComposite model = new OuterComposite(); + + /** + * Model tests for OuterComposite + */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } + + /** + * Test the property 'myNumber' + */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } + + /** + * Test the property 'myString' + */ + @Test + public void myStringTest() { + // TODO: test myString + } + + /** + * Test the property 'myBoolean' + */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java new file mode 100644 index 0000000000..cf0ebae0fa --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -0,0 +1,33 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for OuterEnum + */ +public class OuterEnumTest { + /** + * Model tests for OuterEnum + */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java new file mode 100644 index 0000000000..c3c0d4cc35 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java @@ -0,0 +1,93 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pet + */ +public class PetTest { + private final Pet model = new Pet(); + + /** + * Model tests for Pet + */ + @Test + public void testPet() { + // TODO: test Pet + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java new file mode 100644 index 0000000000..b82a7d0ef5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ReadOnlyFirst + */ +public class ReadOnlyFirstTest { + private final ReadOnlyFirst model = new ReadOnlyFirst(); + + /** + * Model tests for ReadOnlyFirst + */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } + + /** + * Test the property 'bar' + */ + @Test + public void barTest() { + // TODO: test bar + } + + /** + * Test the property 'baz' + */ + @Test + public void bazTest() { + // TODO: test baz + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java new file mode 100644 index 0000000000..d5a19c371e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -0,0 +1,49 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for SpecialModelName + */ +public class SpecialModelNameTest { + private final SpecialModelName model = new SpecialModelName(); + + /** + * Model tests for SpecialModelName + */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + + /** + * Test the property '$specialPropertyName' + */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java new file mode 100644 index 0000000000..5c2cc6f49e --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java @@ -0,0 +1,57 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Tag + */ +public class TagTest { + private final Tag model = new Tag(); + + /** + * Model tests for Tag + */ + @Test + public void testTag() { + // TODO: test Tag + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java new file mode 100644 index 0000000000..e96ac74443 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java @@ -0,0 +1,84 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TypeHolderDefault + */ +public class TypeHolderDefaultTest { + private final TypeHolderDefault model = new TypeHolderDefault(); + + /** + * Model tests for TypeHolderDefault + */ + @Test + public void testTypeHolderDefault() { + // TODO: test TypeHolderDefault + } + + /** + * Test the property 'stringItem' + */ + @Test + public void stringItemTest() { + // TODO: test stringItem + } + + /** + * Test the property 'numberItem' + */ + @Test + public void numberItemTest() { + // TODO: test numberItem + } + + /** + * Test the property 'integerItem' + */ + @Test + public void integerItemTest() { + // TODO: test integerItem + } + + /** + * Test the property 'boolItem' + */ + @Test + public void boolItemTest() { + // TODO: test boolItem + } + + /** + * Test the property 'arrayItem' + */ + @Test + public void arrayItemTest() { + // TODO: test arrayItem + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java new file mode 100644 index 0000000000..56641d163a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java @@ -0,0 +1,92 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for TypeHolderExample + */ +public class TypeHolderExampleTest { + private final TypeHolderExample model = new TypeHolderExample(); + + /** + * Model tests for TypeHolderExample + */ + @Test + public void testTypeHolderExample() { + // TODO: test TypeHolderExample + } + + /** + * Test the property 'stringItem' + */ + @Test + public void stringItemTest() { + // TODO: test stringItem + } + + /** + * Test the property 'numberItem' + */ + @Test + public void numberItemTest() { + // TODO: test numberItem + } + + /** + * Test the property 'floatItem' + */ + @Test + public void floatItemTest() { + // TODO: test floatItem + } + + /** + * Test the property 'integerItem' + */ + @Test + public void integerItemTest() { + // TODO: test integerItem + } + + /** + * Test the property 'boolItem' + */ + @Test + public void boolItemTest() { + // TODO: test boolItem + } + + /** + * Test the property 'arrayItem' + */ + @Test + public void arrayItemTest() { + // TODO: test arrayItem + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java new file mode 100644 index 0000000000..ce40d3a2a6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for User + */ +public class UserTest { + private final User model = new User(); + + /** + * Model tests for User + */ + @Test + public void testUser() { + // TODO: test User + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'username' + */ + @Test + public void usernameTest() { + // TODO: test username + } + + /** + * Test the property 'firstName' + */ + @Test + public void firstNameTest() { + // TODO: test firstName + } + + /** + * Test the property 'lastName' + */ + @Test + public void lastNameTest() { + // TODO: test lastName + } + + /** + * Test the property 'email' + */ + @Test + public void emailTest() { + // TODO: test email + } + + /** + * Test the property 'password' + */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** + * Test the property 'phone' + */ + @Test + public void phoneTest() { + // TODO: test phone + } + + /** + * Test the property 'userStatus' + */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } + +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java new file mode 100644 index 0000000000..501c414555 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java @@ -0,0 +1,276 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for XmlItem + */ +public class XmlItemTest { + private final XmlItem model = new XmlItem(); + + /** + * Model tests for XmlItem + */ + @Test + public void testXmlItem() { + // TODO: test XmlItem + } + + /** + * Test the property 'attributeString' + */ + @Test + public void attributeStringTest() { + // TODO: test attributeString + } + + /** + * Test the property 'attributeNumber' + */ + @Test + public void attributeNumberTest() { + // TODO: test attributeNumber + } + + /** + * Test the property 'attributeInteger' + */ + @Test + public void attributeIntegerTest() { + // TODO: test attributeInteger + } + + /** + * Test the property 'attributeBoolean' + */ + @Test + public void attributeBooleanTest() { + // TODO: test attributeBoolean + } + + /** + * Test the property 'wrappedArray' + */ + @Test + public void wrappedArrayTest() { + // TODO: test wrappedArray + } + + /** + * Test the property 'nameString' + */ + @Test + public void nameStringTest() { + // TODO: test nameString + } + + /** + * Test the property 'nameNumber' + */ + @Test + public void nameNumberTest() { + // TODO: test nameNumber + } + + /** + * Test the property 'nameInteger' + */ + @Test + public void nameIntegerTest() { + // TODO: test nameInteger + } + + /** + * Test the property 'nameBoolean' + */ + @Test + public void nameBooleanTest() { + // TODO: test nameBoolean + } + + /** + * Test the property 'nameArray' + */ + @Test + public void nameArrayTest() { + // TODO: test nameArray + } + + /** + * Test the property 'nameWrappedArray' + */ + @Test + public void nameWrappedArrayTest() { + // TODO: test nameWrappedArray + } + + /** + * Test the property 'prefixString' + */ + @Test + public void prefixStringTest() { + // TODO: test prefixString + } + + /** + * Test the property 'prefixNumber' + */ + @Test + public void prefixNumberTest() { + // TODO: test prefixNumber + } + + /** + * Test the property 'prefixInteger' + */ + @Test + public void prefixIntegerTest() { + // TODO: test prefixInteger + } + + /** + * Test the property 'prefixBoolean' + */ + @Test + public void prefixBooleanTest() { + // TODO: test prefixBoolean + } + + /** + * Test the property 'prefixArray' + */ + @Test + public void prefixArrayTest() { + // TODO: test prefixArray + } + + /** + * Test the property 'prefixWrappedArray' + */ + @Test + public void prefixWrappedArrayTest() { + // TODO: test prefixWrappedArray + } + + /** + * Test the property 'namespaceString' + */ + @Test + public void namespaceStringTest() { + // TODO: test namespaceString + } + + /** + * Test the property 'namespaceNumber' + */ + @Test + public void namespaceNumberTest() { + // TODO: test namespaceNumber + } + + /** + * Test the property 'namespaceInteger' + */ + @Test + public void namespaceIntegerTest() { + // TODO: test namespaceInteger + } + + /** + * Test the property 'namespaceBoolean' + */ + @Test + public void namespaceBooleanTest() { + // TODO: test namespaceBoolean + } + + /** + * Test the property 'namespaceArray' + */ + @Test + public void namespaceArrayTest() { + // TODO: test namespaceArray + } + + /** + * Test the property 'namespaceWrappedArray' + */ + @Test + public void namespaceWrappedArrayTest() { + // TODO: test namespaceWrappedArray + } + + /** + * Test the property 'prefixNsString' + */ + @Test + public void prefixNsStringTest() { + // TODO: test prefixNsString + } + + /** + * Test the property 'prefixNsNumber' + */ + @Test + public void prefixNsNumberTest() { + // TODO: test prefixNsNumber + } + + /** + * Test the property 'prefixNsInteger' + */ + @Test + public void prefixNsIntegerTest() { + // TODO: test prefixNsInteger + } + + /** + * Test the property 'prefixNsBoolean' + */ + @Test + public void prefixNsBooleanTest() { + // TODO: test prefixNsBoolean + } + + /** + * Test the property 'prefixNsArray' + */ + @Test + public void prefixNsArrayTest() { + // TODO: test prefixNsArray + } + + /** + * Test the property 'prefixNsWrappedArray' + */ + @Test + public void prefixNsWrappedArrayTest() { + // TODO: test prefixNsWrappedArray + } + +} diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index 07d2aca7a1..07a49c8614 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -287,7 +287,7 @@ UTF-8 - 1.5.22 + 1.6.1 2.6 2.5 3.6 diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 5244287e17..ae710b33c8 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -276,7 +276,7 @@ UTF-8 - 1.5.22 + 1.6.1 2.27 2.10.3 2.10.3 diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index e5f142a414..a872c647cf 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -282,7 +282,7 @@ UTF-8 - 1.5.22 + 1.6.1 2.27 2.10.3 2.10.3 diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml index e44571cb5f..8f1a907787 100644 --- a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -1919,7 +1919,7 @@ components: properties: color: type: string - x-oneOf-name: Fruit + x-one-of-name: Fruit apple: properties: cultivar: @@ -1939,7 +1939,7 @@ components: oneOf: - $ref: '#/components/schemas/whale' - $ref: '#/components/schemas/zebra' - x-oneOf-name: Mammal + x-one-of-name: Mammal whale: properties: hasBaleen: @@ -1975,7 +1975,7 @@ components: oneOf: - $ref: '#/components/schemas/appleReq' - $ref: '#/components/schemas/bananaReq' - x-oneOf-name: FruitReq + x-one-of-name: FruitReq appleReq: properties: cultivar: From 1e01c380e85cb9fe6449528bf75287dbce07f548 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 23 Apr 2020 22:59:31 -0700 Subject: [PATCH 10/25] [python-experimental] Minor doc update, code comments and exception handling (#5945) * add support for any type, i.e. when 'type' attribute is not specified in OAS schema * fix typos, add code comments * Handle case when 'type' attribute is not present in the OAS schema * fix python formatting rule * fix python formatting rule * remove 'object' as a type --- .../python-experimental/model_utils.mustache | 14 ++++++++------ .../petstore_api/model_utils.py | 14 ++++++++------ .../petstore_api/model_utils.py | 14 ++++++++------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache index 8b60618c1d..58da408a19 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_utils.mustache @@ -74,7 +74,7 @@ COERCION_INDEX_BY_TYPE = { ModelComposed: 0, ModelNormal: 1, ModelSimple: 2, - none_type: 3, + none_type: 3, # The type of 'None'. list: 4, dict: 5, float: 6, @@ -83,7 +83,7 @@ COERCION_INDEX_BY_TYPE = { datetime: 9, date: 10, str: 11, - file_type: 12, + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. } # these are used to limit what type conversions we try to do @@ -352,11 +352,11 @@ def order_response_types(required_types): Args: required_types (list/tuple): collection of classes or instance of - list or dict with classs information inside it + list or dict with class information inside it. Returns: (list): coercion order sorted collection of classes or instance - of list or dict with classs information inside it + of list or dict with class information inside it. """ def index_getter(class_or_instance): @@ -373,7 +373,9 @@ def order_response_types(required_types): elif (inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple)): return COERCION_INDEX_BY_TYPE[ModelSimple] - return COERCION_INDEX_BY_TYPE[class_or_instance] + elif class_or_instance in COERCION_INDEX_BY_TYPE: + return COERCION_INDEX_BY_TYPE[class_or_instance] + raise ApiValueError("Unsupported type: %s" % class_or_instance) sorted_types = sorted( required_types, @@ -391,7 +393,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, these should be ordered by COERCION_INDEX_BY_TYPE from_server (bool): a boolean of whether the data is from the server if false, the data is from the client - current_item (any): the current item to be converted + current_item (any): the current item (input data) to be converted Keyword Args: must_convert (bool): if True the item to convert is of the wrong diff --git a/samples/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/client/petstore/python-experimental/petstore_api/model_utils.py index 2f6b690424..b905f7d347 100644 --- a/samples/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/client/petstore/python-experimental/petstore_api/model_utils.py @@ -336,7 +336,7 @@ COERCION_INDEX_BY_TYPE = { ModelComposed: 0, ModelNormal: 1, ModelSimple: 2, - none_type: 3, + none_type: 3, # The type of 'None'. list: 4, dict: 5, float: 6, @@ -345,7 +345,7 @@ COERCION_INDEX_BY_TYPE = { datetime: 9, date: 10, str: 11, - file_type: 12, + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. } # these are used to limit what type conversions we try to do @@ -614,11 +614,11 @@ def order_response_types(required_types): Args: required_types (list/tuple): collection of classes or instance of - list or dict with classs information inside it + list or dict with class information inside it. Returns: (list): coercion order sorted collection of classes or instance - of list or dict with classs information inside it + of list or dict with class information inside it. """ def index_getter(class_or_instance): @@ -635,7 +635,9 @@ def order_response_types(required_types): elif (inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple)): return COERCION_INDEX_BY_TYPE[ModelSimple] - return COERCION_INDEX_BY_TYPE[class_or_instance] + elif class_or_instance in COERCION_INDEX_BY_TYPE: + return COERCION_INDEX_BY_TYPE[class_or_instance] + raise ApiValueError("Unsupported type: %s" % class_or_instance) sorted_types = sorted( required_types, @@ -653,7 +655,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, these should be ordered by COERCION_INDEX_BY_TYPE from_server (bool): a boolean of whether the data is from the server if false, the data is from the client - current_item (any): the current item to be converted + current_item (any): the current item (input data) to be converted Keyword Args: must_convert (bool): if True the item to convert is of the wrong diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py index 2f6b690424..b905f7d347 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/model_utils.py @@ -336,7 +336,7 @@ COERCION_INDEX_BY_TYPE = { ModelComposed: 0, ModelNormal: 1, ModelSimple: 2, - none_type: 3, + none_type: 3, # The type of 'None'. list: 4, dict: 5, float: 6, @@ -345,7 +345,7 @@ COERCION_INDEX_BY_TYPE = { datetime: 9, date: 10, str: 11, - file_type: 12, + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. } # these are used to limit what type conversions we try to do @@ -614,11 +614,11 @@ def order_response_types(required_types): Args: required_types (list/tuple): collection of classes or instance of - list or dict with classs information inside it + list or dict with class information inside it. Returns: (list): coercion order sorted collection of classes or instance - of list or dict with classs information inside it + of list or dict with class information inside it. """ def index_getter(class_or_instance): @@ -635,7 +635,9 @@ def order_response_types(required_types): elif (inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple)): return COERCION_INDEX_BY_TYPE[ModelSimple] - return COERCION_INDEX_BY_TYPE[class_or_instance] + elif class_or_instance in COERCION_INDEX_BY_TYPE: + return COERCION_INDEX_BY_TYPE[class_or_instance] + raise ApiValueError("Unsupported type: %s" % class_or_instance) sorted_types = sorted( required_types, @@ -653,7 +655,7 @@ def remove_uncoercible(required_types_classes, current_item, from_server, these should be ordered by COERCION_INDEX_BY_TYPE from_server (bool): a boolean of whether the data is from the server if false, the data is from the client - current_item (any): the current item to be converted + current_item (any): the current item (input data) to be converted Keyword Args: must_convert (bool): if True the item to convert is of the wrong From 6ad5e5fb4537ac5acd06266bbbb50adeb8382b2e Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Thu, 23 Apr 2020 23:16:31 -0700 Subject: [PATCH 11/25] [Python experimental] Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info (#6033) * Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info * Add __setattr__ function to ensure signing_info.host is the same as configuration.host when the user assigns signing info --- .../src/main/resources/python/configuration.mustache | 9 +++++++++ .../python-asyncio/petstore_api/configuration.py | 3 +++ .../python-experimental/petstore_api/configuration.py | 3 +++ .../python-tornado/petstore_api/configuration.py | 3 +++ .../client/petstore/python/petstore_api/configuration.py | 3 +++ .../python-experimental/petstore_api/configuration.py | 7 +++++++ .../client/petstore/python/petstore_api/configuration.py | 3 +++ 7 files changed, 31 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 6581e603ad..7fdcd89427 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -271,6 +271,15 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) +{{#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 +{{/hasHttpSignatureMethods}} + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index 025188fd17..ef96f1bc5c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -195,6 +195,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 03ac961e1d..066665d16f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 03ac961e1d..066665d16f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 03ac961e1d..066665d16f 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index d68709a5d8..d885572339 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -246,6 +246,13 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + 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. diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 994d4c73fb..d0d05b1138 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -199,6 +199,9 @@ class Configuration(object): result.debug = self.debug return result + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + @classmethod def set_default(cls, default): """Set default instance of configuration. From 649daed9a94e2fc79d384f37f0670dc2528e0544 Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Fri, 24 Apr 2020 14:44:48 +0200 Subject: [PATCH 12/25] Export valid and set status of properties (#6020) --- .../cpp-qt5-client/model-body.mustache | 8 +++ .../cpp-qt5-client/model-header.mustache | 2 + .../model-body.mustache | 8 +++ .../model-header.mustache | 2 + .../cpp-qt5/client/PFXApiResponse.cpp | 24 +++++++ .../petstore/cpp-qt5/client/PFXApiResponse.h | 6 ++ .../petstore/cpp-qt5/client/PFXCategory.cpp | 16 +++++ .../petstore/cpp-qt5/client/PFXCategory.h | 4 ++ .../petstore/cpp-qt5/client/PFXOrder.cpp | 48 ++++++++++++++ .../client/petstore/cpp-qt5/client/PFXOrder.h | 12 ++++ .../client/petstore/cpp-qt5/client/PFXPet.cpp | 48 ++++++++++++++ .../client/petstore/cpp-qt5/client/PFXPet.h | 12 ++++ .../client/petstore/cpp-qt5/client/PFXTag.cpp | 16 +++++ .../client/petstore/cpp-qt5/client/PFXTag.h | 4 ++ .../petstore/cpp-qt5/client/PFXUser.cpp | 64 +++++++++++++++++++ .../client/petstore/cpp-qt5/client/PFXUser.h | 16 +++++ .../server/src/models/OAIApiResponse.cpp | 24 +++++++ .../server/src/models/OAIApiResponse.h | 6 ++ .../server/src/models/OAICategory.cpp | 16 +++++ .../server/src/models/OAICategory.h | 4 ++ .../server/src/models/OAIOrder.cpp | 48 ++++++++++++++ .../server/src/models/OAIOrder.h | 12 ++++ .../server/src/models/OAIPet.cpp | 48 ++++++++++++++ .../server/src/models/OAIPet.h | 12 ++++ .../server/src/models/OAITag.cpp | 16 +++++ .../server/src/models/OAITag.h | 4 ++ .../server/src/models/OAIUser.cpp | 64 +++++++++++++++++++ .../server/src/models/OAIUser.h | 16 +++++ 28 files changed, 560 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache index 05f22ceb8f..e48e1597db 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-body.mustache @@ -120,6 +120,14 @@ void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) { this->m_{{name}}_isSet = true; } +bool {{classname}}::is_{{name}}_Set() const{ + return m_{{name}}_isSet; +} + +bool {{classname}}::is_{{name}}_Valid() const{ + return m_{{name}}_isValid; +} + {{/vars}}{{/isEnum}}{{#isEnum}} {{classname}}::e{{classname}} {{classname}}::getValue() const { return m_value; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache index 8f194ac12f..5bbe8c8c20 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/model-header.mustache @@ -35,6 +35,8 @@ public: {{^isEnum}}{{#vars}} {{{dataType}}} {{getter}}() const; void {{setter}}(const {{{dataType}}} &{{name}}); + bool is_{{name}}_Set() const; + bool is_{{name}}_Valid() const; {{/vars}}{{/isEnum}}{{#isEnum}} {{#allowableValues}} enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache index 05f22ceb8f..e48e1597db 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-body.mustache @@ -120,6 +120,14 @@ void {{classname}}::{{setter}}(const {{{dataType}}} &{{name}}) { this->m_{{name}}_isSet = true; } +bool {{classname}}::is_{{name}}_Set() const{ + return m_{{name}}_isSet; +} + +bool {{classname}}::is_{{name}}_Valid() const{ + return m_{{name}}_isValid; +} + {{/vars}}{{/isEnum}}{{#isEnum}} {{classname}}::e{{classname}} {{classname}}::getValue() const { return m_value; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache index 8f194ac12f..5bbe8c8c20 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server/model-header.mustache @@ -35,6 +35,8 @@ public: {{^isEnum}}{{#vars}} {{{dataType}}} {{getter}}() const; void {{setter}}(const {{{dataType}}} &{{name}}); + bool is_{{name}}_Set() const; + bool is_{{name}}_Valid() const; {{/vars}}{{/isEnum}}{{#isEnum}} {{#allowableValues}} enum class e{{classname}} {{#enumVars}}{{#-first}}{{^isString}}: int {{/isString}}{{/-first}}{{/enumVars}}{ diff --git a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp index 4814531785..f7b652df27 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp @@ -91,6 +91,14 @@ void PFXApiResponse::setCode(const qint32 &code) { this->m_code_isSet = true; } +bool PFXApiResponse::is_code_Set() const{ + return m_code_isSet; +} + +bool PFXApiResponse::is_code_Valid() const{ + return m_code_isValid; +} + QString PFXApiResponse::getType() const { return type; } @@ -99,6 +107,14 @@ void PFXApiResponse::setType(const QString &type) { this->m_type_isSet = true; } +bool PFXApiResponse::is_type_Set() const{ + return m_type_isSet; +} + +bool PFXApiResponse::is_type_Valid() const{ + return m_type_isValid; +} + QString PFXApiResponse::getMessage() const { return message; } @@ -107,6 +123,14 @@ void PFXApiResponse::setMessage(const QString &message) { this->m_message_isSet = true; } +bool PFXApiResponse::is_message_Set() const{ + return m_message_isSet; +} + +bool PFXApiResponse::is_message_Valid() const{ + return m_message_isValid; +} + bool PFXApiResponse::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h index 9729da2e07..e4ba4d4dd0 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h +++ b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h @@ -40,12 +40,18 @@ public: qint32 getCode() const; void setCode(const qint32 &code); + bool is_code_Set() const; + bool is_code_Valid() const; QString getType() const; void setType(const QString &type); + bool is_type_Set() const; + bool is_type_Valid() const; QString getMessage() const; void setMessage(const QString &message); + bool is_message_Set() const; + bool is_message_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp b/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp index 887d11c73e..f39272a12a 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp @@ -82,6 +82,14 @@ void PFXCategory::setId(const qint64 &id) { this->m_id_isSet = true; } +bool PFXCategory::is_id_Set() const{ + return m_id_isSet; +} + +bool PFXCategory::is_id_Valid() const{ + return m_id_isValid; +} + QString PFXCategory::getName() const { return name; } @@ -90,6 +98,14 @@ void PFXCategory::setName(const QString &name) { this->m_name_isSet = true; } +bool PFXCategory::is_name_Set() const{ + return m_name_isSet; +} + +bool PFXCategory::is_name_Valid() const{ + return m_name_isValid; +} + bool PFXCategory::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXCategory.h b/samples/client/petstore/cpp-qt5/client/PFXCategory.h index 84ce65c626..544a946b1d 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXCategory.h +++ b/samples/client/petstore/cpp-qt5/client/PFXCategory.h @@ -40,9 +40,13 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp b/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp index b62979c8fe..ccafb4c74c 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp @@ -118,6 +118,14 @@ void PFXOrder::setId(const qint64 &id) { this->m_id_isSet = true; } +bool PFXOrder::is_id_Set() const{ + return m_id_isSet; +} + +bool PFXOrder::is_id_Valid() const{ + return m_id_isValid; +} + qint64 PFXOrder::getPetId() const { return pet_id; } @@ -126,6 +134,14 @@ void PFXOrder::setPetId(const qint64 &pet_id) { this->m_pet_id_isSet = true; } +bool PFXOrder::is_pet_id_Set() const{ + return m_pet_id_isSet; +} + +bool PFXOrder::is_pet_id_Valid() const{ + return m_pet_id_isValid; +} + qint32 PFXOrder::getQuantity() const { return quantity; } @@ -134,6 +150,14 @@ void PFXOrder::setQuantity(const qint32 &quantity) { this->m_quantity_isSet = true; } +bool PFXOrder::is_quantity_Set() const{ + return m_quantity_isSet; +} + +bool PFXOrder::is_quantity_Valid() const{ + return m_quantity_isValid; +} + QDateTime PFXOrder::getShipDate() const { return ship_date; } @@ -142,6 +166,14 @@ void PFXOrder::setShipDate(const QDateTime &ship_date) { this->m_ship_date_isSet = true; } +bool PFXOrder::is_ship_date_Set() const{ + return m_ship_date_isSet; +} + +bool PFXOrder::is_ship_date_Valid() const{ + return m_ship_date_isValid; +} + QString PFXOrder::getStatus() const { return status; } @@ -150,6 +182,14 @@ void PFXOrder::setStatus(const QString &status) { this->m_status_isSet = true; } +bool PFXOrder::is_status_Set() const{ + return m_status_isSet; +} + +bool PFXOrder::is_status_Valid() const{ + return m_status_isValid; +} + bool PFXOrder::isComplete() const { return complete; } @@ -158,6 +198,14 @@ void PFXOrder::setComplete(const bool &complete) { this->m_complete_isSet = true; } +bool PFXOrder::is_complete_Set() const{ + return m_complete_isSet; +} + +bool PFXOrder::is_complete_Valid() const{ + return m_complete_isValid; +} + bool PFXOrder::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXOrder.h b/samples/client/petstore/cpp-qt5/client/PFXOrder.h index 1c10026823..6ff0993304 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXOrder.h +++ b/samples/client/petstore/cpp-qt5/client/PFXOrder.h @@ -41,21 +41,33 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; qint64 getPetId() const; void setPetId(const qint64 &pet_id); + bool is_pet_id_Set() const; + bool is_pet_id_Valid() const; qint32 getQuantity() const; void setQuantity(const qint32 &quantity); + bool is_quantity_Set() const; + bool is_quantity_Valid() const; QDateTime getShipDate() const; void setShipDate(const QDateTime &ship_date); + bool is_ship_date_Set() const; + bool is_ship_date_Valid() const; QString getStatus() const; void setStatus(const QString &status); + bool is_status_Set() const; + bool is_status_Valid() const; bool isComplete() const; void setComplete(const bool &complete); + bool is_complete_Set() const; + bool is_complete_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/client/petstore/cpp-qt5/client/PFXPet.cpp b/samples/client/petstore/cpp-qt5/client/PFXPet.cpp index 1f12495749..0d06a35c39 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPet.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXPet.cpp @@ -118,6 +118,14 @@ void PFXPet::setId(const qint64 &id) { this->m_id_isSet = true; } +bool PFXPet::is_id_Set() const{ + return m_id_isSet; +} + +bool PFXPet::is_id_Valid() const{ + return m_id_isValid; +} + PFXCategory PFXPet::getCategory() const { return category; } @@ -126,6 +134,14 @@ void PFXPet::setCategory(const PFXCategory &category) { this->m_category_isSet = true; } +bool PFXPet::is_category_Set() const{ + return m_category_isSet; +} + +bool PFXPet::is_category_Valid() const{ + return m_category_isValid; +} + QString PFXPet::getName() const { return name; } @@ -134,6 +150,14 @@ void PFXPet::setName(const QString &name) { this->m_name_isSet = true; } +bool PFXPet::is_name_Set() const{ + return m_name_isSet; +} + +bool PFXPet::is_name_Valid() const{ + return m_name_isValid; +} + QList PFXPet::getPhotoUrls() const { return photo_urls; } @@ -142,6 +166,14 @@ void PFXPet::setPhotoUrls(const QList &photo_urls) { this->m_photo_urls_isSet = true; } +bool PFXPet::is_photo_urls_Set() const{ + return m_photo_urls_isSet; +} + +bool PFXPet::is_photo_urls_Valid() const{ + return m_photo_urls_isValid; +} + QList PFXPet::getTags() const { return tags; } @@ -150,6 +182,14 @@ void PFXPet::setTags(const QList &tags) { this->m_tags_isSet = true; } +bool PFXPet::is_tags_Set() const{ + return m_tags_isSet; +} + +bool PFXPet::is_tags_Valid() const{ + return m_tags_isValid; +} + QString PFXPet::getStatus() const { return status; } @@ -158,6 +198,14 @@ void PFXPet::setStatus(const QString &status) { this->m_status_isSet = true; } +bool PFXPet::is_status_Set() const{ + return m_status_isSet; +} + +bool PFXPet::is_status_Valid() const{ + return m_status_isValid; +} + bool PFXPet::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXPet.h b/samples/client/petstore/cpp-qt5/client/PFXPet.h index 4d20e3d8a5..b84bfc6d93 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXPet.h +++ b/samples/client/petstore/cpp-qt5/client/PFXPet.h @@ -43,21 +43,33 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; PFXCategory getCategory() const; void setCategory(const PFXCategory &category); + bool is_category_Set() const; + bool is_category_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; QList getPhotoUrls() const; void setPhotoUrls(const QList &photo_urls); + bool is_photo_urls_Set() const; + bool is_photo_urls_Valid() const; QList getTags() const; void setTags(const QList &tags); + bool is_tags_Set() const; + bool is_tags_Valid() const; QString getStatus() const; void setStatus(const QString &status); + bool is_status_Set() const; + bool is_status_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/client/petstore/cpp-qt5/client/PFXTag.cpp b/samples/client/petstore/cpp-qt5/client/PFXTag.cpp index 4a046506c6..2f3e76a34a 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXTag.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXTag.cpp @@ -82,6 +82,14 @@ void PFXTag::setId(const qint64 &id) { this->m_id_isSet = true; } +bool PFXTag::is_id_Set() const{ + return m_id_isSet; +} + +bool PFXTag::is_id_Valid() const{ + return m_id_isValid; +} + QString PFXTag::getName() const { return name; } @@ -90,6 +98,14 @@ void PFXTag::setName(const QString &name) { this->m_name_isSet = true; } +bool PFXTag::is_name_Set() const{ + return m_name_isSet; +} + +bool PFXTag::is_name_Valid() const{ + return m_name_isValid; +} + bool PFXTag::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXTag.h b/samples/client/petstore/cpp-qt5/client/PFXTag.h index 6b80e1312e..93d8a08b82 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXTag.h +++ b/samples/client/petstore/cpp-qt5/client/PFXTag.h @@ -40,9 +40,13 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/client/petstore/cpp-qt5/client/PFXUser.cpp b/samples/client/petstore/cpp-qt5/client/PFXUser.cpp index 3a8e4eef1c..a3e9c64836 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUser.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXUser.cpp @@ -136,6 +136,14 @@ void PFXUser::setId(const qint64 &id) { this->m_id_isSet = true; } +bool PFXUser::is_id_Set() const{ + return m_id_isSet; +} + +bool PFXUser::is_id_Valid() const{ + return m_id_isValid; +} + QString PFXUser::getUsername() const { return username; } @@ -144,6 +152,14 @@ void PFXUser::setUsername(const QString &username) { this->m_username_isSet = true; } +bool PFXUser::is_username_Set() const{ + return m_username_isSet; +} + +bool PFXUser::is_username_Valid() const{ + return m_username_isValid; +} + QString PFXUser::getFirstName() const { return first_name; } @@ -152,6 +168,14 @@ void PFXUser::setFirstName(const QString &first_name) { this->m_first_name_isSet = true; } +bool PFXUser::is_first_name_Set() const{ + return m_first_name_isSet; +} + +bool PFXUser::is_first_name_Valid() const{ + return m_first_name_isValid; +} + QString PFXUser::getLastName() const { return last_name; } @@ -160,6 +184,14 @@ void PFXUser::setLastName(const QString &last_name) { this->m_last_name_isSet = true; } +bool PFXUser::is_last_name_Set() const{ + return m_last_name_isSet; +} + +bool PFXUser::is_last_name_Valid() const{ + return m_last_name_isValid; +} + QString PFXUser::getEmail() const { return email; } @@ -168,6 +200,14 @@ void PFXUser::setEmail(const QString &email) { this->m_email_isSet = true; } +bool PFXUser::is_email_Set() const{ + return m_email_isSet; +} + +bool PFXUser::is_email_Valid() const{ + return m_email_isValid; +} + QString PFXUser::getPassword() const { return password; } @@ -176,6 +216,14 @@ void PFXUser::setPassword(const QString &password) { this->m_password_isSet = true; } +bool PFXUser::is_password_Set() const{ + return m_password_isSet; +} + +bool PFXUser::is_password_Valid() const{ + return m_password_isValid; +} + QString PFXUser::getPhone() const { return phone; } @@ -184,6 +232,14 @@ void PFXUser::setPhone(const QString &phone) { this->m_phone_isSet = true; } +bool PFXUser::is_phone_Set() const{ + return m_phone_isSet; +} + +bool PFXUser::is_phone_Valid() const{ + return m_phone_isValid; +} + qint32 PFXUser::getUserStatus() const { return user_status; } @@ -192,6 +248,14 @@ void PFXUser::setUserStatus(const qint32 &user_status) { this->m_user_status_isSet = true; } +bool PFXUser::is_user_status_Set() const{ + return m_user_status_isSet; +} + +bool PFXUser::is_user_status_Valid() const{ + return m_user_status_isValid; +} + bool PFXUser::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/client/petstore/cpp-qt5/client/PFXUser.h b/samples/client/petstore/cpp-qt5/client/PFXUser.h index df23a4734c..a8ce7f8356 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXUser.h +++ b/samples/client/petstore/cpp-qt5/client/PFXUser.h @@ -40,27 +40,43 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getUsername() const; void setUsername(const QString &username); + bool is_username_Set() const; + bool is_username_Valid() const; QString getFirstName() const; void setFirstName(const QString &first_name); + bool is_first_name_Set() const; + bool is_first_name_Valid() const; QString getLastName() const; void setLastName(const QString &last_name); + bool is_last_name_Set() const; + bool is_last_name_Valid() const; QString getEmail() const; void setEmail(const QString &email); + bool is_email_Set() const; + bool is_email_Valid() const; QString getPassword() const; void setPassword(const QString &password); + bool is_password_Set() const; + bool is_password_Valid() const; QString getPhone() const; void setPhone(const QString &phone); + bool is_phone_Set() const; + bool is_phone_Valid() const; qint32 getUserStatus() const; void setUserStatus(const qint32 &user_status); + bool is_user_status_Set() const; + bool is_user_status_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp index 1099e88df0..4d14b56749 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.cpp @@ -91,6 +91,14 @@ void OAIApiResponse::setCode(const qint32 &code) { this->m_code_isSet = true; } +bool OAIApiResponse::is_code_Set() const{ + return m_code_isSet; +} + +bool OAIApiResponse::is_code_Valid() const{ + return m_code_isValid; +} + QString OAIApiResponse::getType() const { return type; } @@ -99,6 +107,14 @@ void OAIApiResponse::setType(const QString &type) { this->m_type_isSet = true; } +bool OAIApiResponse::is_type_Set() const{ + return m_type_isSet; +} + +bool OAIApiResponse::is_type_Valid() const{ + return m_type_isValid; +} + QString OAIApiResponse::getMessage() const { return message; } @@ -107,6 +123,14 @@ void OAIApiResponse::setMessage(const QString &message) { this->m_message_isSet = true; } +bool OAIApiResponse::is_message_Set() const{ + return m_message_isSet; +} + +bool OAIApiResponse::is_message_Valid() const{ + return m_message_isValid; +} + bool OAIApiResponse::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h index 1dc044d47d..f24fb1acba 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIApiResponse.h @@ -40,12 +40,18 @@ public: qint32 getCode() const; void setCode(const qint32 &code); + bool is_code_Set() const; + bool is_code_Valid() const; QString getType() const; void setType(const QString &type); + bool is_type_Set() const; + bool is_type_Valid() const; QString getMessage() const; void setMessage(const QString &message); + bool is_message_Set() const; + bool is_message_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp index 1945693f15..40876b8854 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.cpp @@ -82,6 +82,14 @@ void OAICategory::setId(const qint64 &id) { this->m_id_isSet = true; } +bool OAICategory::is_id_Set() const{ + return m_id_isSet; +} + +bool OAICategory::is_id_Valid() const{ + return m_id_isValid; +} + QString OAICategory::getName() const { return name; } @@ -90,6 +98,14 @@ void OAICategory::setName(const QString &name) { this->m_name_isSet = true; } +bool OAICategory::is_name_Set() const{ + return m_name_isSet; +} + +bool OAICategory::is_name_Valid() const{ + return m_name_isValid; +} + bool OAICategory::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h index e091b32946..8cda3322ad 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAICategory.h @@ -40,9 +40,13 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp index 296e9589d0..28536d66f2 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.cpp @@ -118,6 +118,14 @@ void OAIOrder::setId(const qint64 &id) { this->m_id_isSet = true; } +bool OAIOrder::is_id_Set() const{ + return m_id_isSet; +} + +bool OAIOrder::is_id_Valid() const{ + return m_id_isValid; +} + qint64 OAIOrder::getPetId() const { return pet_id; } @@ -126,6 +134,14 @@ void OAIOrder::setPetId(const qint64 &pet_id) { this->m_pet_id_isSet = true; } +bool OAIOrder::is_pet_id_Set() const{ + return m_pet_id_isSet; +} + +bool OAIOrder::is_pet_id_Valid() const{ + return m_pet_id_isValid; +} + qint32 OAIOrder::getQuantity() const { return quantity; } @@ -134,6 +150,14 @@ void OAIOrder::setQuantity(const qint32 &quantity) { this->m_quantity_isSet = true; } +bool OAIOrder::is_quantity_Set() const{ + return m_quantity_isSet; +} + +bool OAIOrder::is_quantity_Valid() const{ + return m_quantity_isValid; +} + QDateTime OAIOrder::getShipDate() const { return ship_date; } @@ -142,6 +166,14 @@ void OAIOrder::setShipDate(const QDateTime &ship_date) { this->m_ship_date_isSet = true; } +bool OAIOrder::is_ship_date_Set() const{ + return m_ship_date_isSet; +} + +bool OAIOrder::is_ship_date_Valid() const{ + return m_ship_date_isValid; +} + QString OAIOrder::getStatus() const { return status; } @@ -150,6 +182,14 @@ void OAIOrder::setStatus(const QString &status) { this->m_status_isSet = true; } +bool OAIOrder::is_status_Set() const{ + return m_status_isSet; +} + +bool OAIOrder::is_status_Valid() const{ + return m_status_isValid; +} + bool OAIOrder::isComplete() const { return complete; } @@ -158,6 +198,14 @@ void OAIOrder::setComplete(const bool &complete) { this->m_complete_isSet = true; } +bool OAIOrder::is_complete_Set() const{ + return m_complete_isSet; +} + +bool OAIOrder::is_complete_Valid() const{ + return m_complete_isValid; +} + bool OAIOrder::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h index 983c947855..0812753b8f 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIOrder.h @@ -41,21 +41,33 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; qint64 getPetId() const; void setPetId(const qint64 &pet_id); + bool is_pet_id_Set() const; + bool is_pet_id_Valid() const; qint32 getQuantity() const; void setQuantity(const qint32 &quantity); + bool is_quantity_Set() const; + bool is_quantity_Valid() const; QDateTime getShipDate() const; void setShipDate(const QDateTime &ship_date); + bool is_ship_date_Set() const; + bool is_ship_date_Valid() const; QString getStatus() const; void setStatus(const QString &status); + bool is_status_Set() const; + bool is_status_Valid() const; bool isComplete() const; void setComplete(const bool &complete); + bool is_complete_Set() const; + bool is_complete_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp index 9c3fca7c83..41535649f8 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.cpp @@ -118,6 +118,14 @@ void OAIPet::setId(const qint64 &id) { this->m_id_isSet = true; } +bool OAIPet::is_id_Set() const{ + return m_id_isSet; +} + +bool OAIPet::is_id_Valid() const{ + return m_id_isValid; +} + OAICategory OAIPet::getCategory() const { return category; } @@ -126,6 +134,14 @@ void OAIPet::setCategory(const OAICategory &category) { this->m_category_isSet = true; } +bool OAIPet::is_category_Set() const{ + return m_category_isSet; +} + +bool OAIPet::is_category_Valid() const{ + return m_category_isValid; +} + QString OAIPet::getName() const { return name; } @@ -134,6 +150,14 @@ void OAIPet::setName(const QString &name) { this->m_name_isSet = true; } +bool OAIPet::is_name_Set() const{ + return m_name_isSet; +} + +bool OAIPet::is_name_Valid() const{ + return m_name_isValid; +} + QList OAIPet::getPhotoUrls() const { return photo_urls; } @@ -142,6 +166,14 @@ void OAIPet::setPhotoUrls(const QList &photo_urls) { this->m_photo_urls_isSet = true; } +bool OAIPet::is_photo_urls_Set() const{ + return m_photo_urls_isSet; +} + +bool OAIPet::is_photo_urls_Valid() const{ + return m_photo_urls_isValid; +} + QList OAIPet::getTags() const { return tags; } @@ -150,6 +182,14 @@ void OAIPet::setTags(const QList &tags) { this->m_tags_isSet = true; } +bool OAIPet::is_tags_Set() const{ + return m_tags_isSet; +} + +bool OAIPet::is_tags_Valid() const{ + return m_tags_isValid; +} + QString OAIPet::getStatus() const { return status; } @@ -158,6 +198,14 @@ void OAIPet::setStatus(const QString &status) { this->m_status_isSet = true; } +bool OAIPet::is_status_Set() const{ + return m_status_isSet; +} + +bool OAIPet::is_status_Valid() const{ + return m_status_isValid; +} + bool OAIPet::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h index 73d40aed28..688d824c89 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIPet.h @@ -43,21 +43,33 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; OAICategory getCategory() const; void setCategory(const OAICategory &category); + bool is_category_Set() const; + bool is_category_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; QList getPhotoUrls() const; void setPhotoUrls(const QList &photo_urls); + bool is_photo_urls_Set() const; + bool is_photo_urls_Valid() const; QList getTags() const; void setTags(const QList &tags); + bool is_tags_Set() const; + bool is_tags_Valid() const; QString getStatus() const; void setStatus(const QString &status); + bool is_status_Set() const; + bool is_status_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp index 636bda52af..44444ed436 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.cpp @@ -82,6 +82,14 @@ void OAITag::setId(const qint64 &id) { this->m_id_isSet = true; } +bool OAITag::is_id_Set() const{ + return m_id_isSet; +} + +bool OAITag::is_id_Valid() const{ + return m_id_isValid; +} + QString OAITag::getName() const { return name; } @@ -90,6 +98,14 @@ void OAITag::setName(const QString &name) { this->m_name_isSet = true; } +bool OAITag::is_name_Set() const{ + return m_name_isSet; +} + +bool OAITag::is_name_Valid() const{ + return m_name_isValid; +} + bool OAITag::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h index aa7c600780..daef5db285 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAITag.h @@ -40,9 +40,13 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getName() const; void setName(const QString &name); + bool is_name_Set() const; + bool is_name_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp index a20a60929d..b039d4fc12 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.cpp @@ -136,6 +136,14 @@ void OAIUser::setId(const qint64 &id) { this->m_id_isSet = true; } +bool OAIUser::is_id_Set() const{ + return m_id_isSet; +} + +bool OAIUser::is_id_Valid() const{ + return m_id_isValid; +} + QString OAIUser::getUsername() const { return username; } @@ -144,6 +152,14 @@ void OAIUser::setUsername(const QString &username) { this->m_username_isSet = true; } +bool OAIUser::is_username_Set() const{ + return m_username_isSet; +} + +bool OAIUser::is_username_Valid() const{ + return m_username_isValid; +} + QString OAIUser::getFirstName() const { return first_name; } @@ -152,6 +168,14 @@ void OAIUser::setFirstName(const QString &first_name) { this->m_first_name_isSet = true; } +bool OAIUser::is_first_name_Set() const{ + return m_first_name_isSet; +} + +bool OAIUser::is_first_name_Valid() const{ + return m_first_name_isValid; +} + QString OAIUser::getLastName() const { return last_name; } @@ -160,6 +184,14 @@ void OAIUser::setLastName(const QString &last_name) { this->m_last_name_isSet = true; } +bool OAIUser::is_last_name_Set() const{ + return m_last_name_isSet; +} + +bool OAIUser::is_last_name_Valid() const{ + return m_last_name_isValid; +} + QString OAIUser::getEmail() const { return email; } @@ -168,6 +200,14 @@ void OAIUser::setEmail(const QString &email) { this->m_email_isSet = true; } +bool OAIUser::is_email_Set() const{ + return m_email_isSet; +} + +bool OAIUser::is_email_Valid() const{ + return m_email_isValid; +} + QString OAIUser::getPassword() const { return password; } @@ -176,6 +216,14 @@ void OAIUser::setPassword(const QString &password) { this->m_password_isSet = true; } +bool OAIUser::is_password_Set() const{ + return m_password_isSet; +} + +bool OAIUser::is_password_Valid() const{ + return m_password_isValid; +} + QString OAIUser::getPhone() const { return phone; } @@ -184,6 +232,14 @@ void OAIUser::setPhone(const QString &phone) { this->m_phone_isSet = true; } +bool OAIUser::is_phone_Set() const{ + return m_phone_isSet; +} + +bool OAIUser::is_phone_Valid() const{ + return m_phone_isValid; +} + qint32 OAIUser::getUserStatus() const { return user_status; } @@ -192,6 +248,14 @@ void OAIUser::setUserStatus(const qint32 &user_status) { this->m_user_status_isSet = true; } +bool OAIUser::is_user_status_Set() const{ + return m_user_status_isSet; +} + +bool OAIUser::is_user_status_Valid() const{ + return m_user_status_isValid; +} + bool OAIUser::isSet() const { bool isObjectUpdated = false; do { diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h index fee30755c2..7508a79d1d 100644 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h +++ b/samples/server/petstore/cpp-qt5-qhttpengine-server/server/src/models/OAIUser.h @@ -40,27 +40,43 @@ public: qint64 getId() const; void setId(const qint64 &id); + bool is_id_Set() const; + bool is_id_Valid() const; QString getUsername() const; void setUsername(const QString &username); + bool is_username_Set() const; + bool is_username_Valid() const; QString getFirstName() const; void setFirstName(const QString &first_name); + bool is_first_name_Set() const; + bool is_first_name_Valid() const; QString getLastName() const; void setLastName(const QString &last_name); + bool is_last_name_Set() const; + bool is_last_name_Valid() const; QString getEmail() const; void setEmail(const QString &email); + bool is_email_Set() const; + bool is_email_Valid() const; QString getPassword() const; void setPassword(const QString &password); + bool is_password_Set() const; + bool is_password_Valid() const; QString getPhone() const; void setPhone(const QString &phone); + bool is_phone_Set() const; + bool is_phone_Valid() const; qint32 getUserStatus() const; void setUserStatus(const qint32 &user_status); + bool is_user_status_Set() const; + bool is_user_status_Valid() const; virtual bool isSet() const override; virtual bool isValid() const override; From 234053fed9885ea00d2f20d61117d94914154c1f Mon Sep 17 00:00:00 2001 From: sunn <33183834+etherealjoy@users.noreply.github.com> Date: Fri, 24 Apr 2020 14:46:25 +0200 Subject: [PATCH 13/25] Export response code to worker (#6021) --- .../cpp-qt5-client/HttpRequest.cpp.mustache | 13 ++++++++++++- .../resources/cpp-qt5-client/HttpRequest.h.mustache | 12 +++++++++--- .../petstore/cpp-qt5/client/PFXHttpRequest.cpp | 13 ++++++++++++- .../client/petstore/cpp-qt5/client/PFXHttpRequest.h | 12 +++++++++--- 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache index b75d14275a..6ec3d67bca 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.cpp.mustache @@ -45,7 +45,7 @@ void {{prefix}}HttpRequestInput::add_file(QString variable_name, QString local_f } {{prefix}}HttpRequestWorker::{{prefix}}HttpRequestWorker(QObject *parent) - : QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false) { + : QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { qsrand(QDateTime::currentDateTime().toTime_t()); manager = new QNetworkAccessManager(this); workingDirectory = QDir::currentPath(); @@ -110,6 +110,10 @@ void {{prefix}}HttpRequestWorker::setRequestCompressionEnabled(bool enable) { isRequestCompressionEnabled = enable; } +int {{prefix}}HttpRequestWorker::getHttpResponseCode() const{ + return httpResponseCode; +} + QString {{prefix}}HttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -360,6 +364,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { } void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { + bool codeSts = false; if(timeOutTimer.isActive()) { QObject::disconnect(&timeOutTimer, &QTimer::timeout, nullptr, nullptr); timeOutTimer.stop(); @@ -371,6 +376,12 @@ void {{prefix}}HttpRequestWorker::on_manager_finished(QNetworkReply *reply) { headers.insert(item.first, item.second); } } + auto rescode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(&codeSts); + if(codeSts){ + httpResponseCode = rescode; + } else{ + httpResponseCode = -1; + } process_response(reply); reply->deleteLater(); emit on_execution_finished(this); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache index 247f590684..efd3525688 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt5-client/HttpRequest.h.mustache @@ -50,11 +50,12 @@ class {{prefix}}HttpRequestWorker : public QObject { Q_OBJECT public: + explicit {{prefix}}HttpRequestWorker(QObject *parent = nullptr); + virtual ~{{prefix}}HttpRequestWorker(); + QByteArray response; QNetworkReply::NetworkError error_type; QString error_str; - explicit {{prefix}}HttpRequestWorker(QObject *parent = nullptr); - virtual ~{{prefix}}HttpRequestWorker(); QMap getResponseHeaders() const; QString http_attribute_encode(QString attribute_name, QString input); @@ -66,6 +67,8 @@ public: QByteArray *getMultiPartField(const QString &fieldname = QString()); void setResponseCompressionEnabled(bool enable); void setRequestCompressionEnabled(bool enable); + int getHttpResponseCode() const; + signals: void on_execution_finished({{prefix}}HttpRequestWorker *worker); @@ -82,10 +85,13 @@ private: QTimer timeOutTimer; bool isResponseCompressionEnabled; bool isRequestCompressionEnabled; + int httpResponseCode; + void on_manager_timeout(QNetworkReply *reply); void process_response(QNetworkReply *reply); QByteArray decompress(const QByteArray& data); - QByteArray compress(const QByteArray& input, int level, {{prefix}}CompressionType compressType); + QByteArray compress(const QByteArray& input, int level, {{prefix}}CompressionType compressType); + private slots: void on_manager_finished(QNetworkReply *reply); }; diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp index ce71caf6a6..746bd57086 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp @@ -52,7 +52,7 @@ void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename } PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent) - : QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false) { + : QObject(parent), manager(nullptr), timeOutTimer(this), isResponseCompressionEnabled(false), isRequestCompressionEnabled(false), httpResponseCode(-1) { qsrand(QDateTime::currentDateTime().toTime_t()); manager = new QNetworkAccessManager(this); workingDirectory = QDir::currentPath(); @@ -117,6 +117,10 @@ void PFXHttpRequestWorker::setRequestCompressionEnabled(bool enable) { isRequestCompressionEnabled = enable; } +int PFXHttpRequestWorker::getHttpResponseCode() const{ + return httpResponseCode; +} + QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { // result structure follows RFC 5987 bool need_utf_encoding = false; @@ -367,6 +371,7 @@ void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { } void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { + bool codeSts = false; if(timeOutTimer.isActive()) { QObject::disconnect(&timeOutTimer, &QTimer::timeout, nullptr, nullptr); timeOutTimer.stop(); @@ -378,6 +383,12 @@ void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { headers.insert(item.first, item.second); } } + auto rescode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(&codeSts); + if(codeSts){ + httpResponseCode = rescode; + } else{ + httpResponseCode = -1; + } process_response(reply); reply->deleteLater(); emit on_execution_finished(this); diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h index acbb0a8d01..aa5743be30 100644 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h +++ b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h @@ -58,11 +58,12 @@ class PFXHttpRequestWorker : public QObject { Q_OBJECT public: + explicit PFXHttpRequestWorker(QObject *parent = nullptr); + virtual ~PFXHttpRequestWorker(); + QByteArray response; QNetworkReply::NetworkError error_type; QString error_str; - explicit PFXHttpRequestWorker(QObject *parent = nullptr); - virtual ~PFXHttpRequestWorker(); QMap getResponseHeaders() const; QString http_attribute_encode(QString attribute_name, QString input); @@ -74,6 +75,8 @@ public: QByteArray *getMultiPartField(const QString &fieldname = QString()); void setResponseCompressionEnabled(bool enable); void setRequestCompressionEnabled(bool enable); + int getHttpResponseCode() const; + signals: void on_execution_finished(PFXHttpRequestWorker *worker); @@ -90,10 +93,13 @@ private: QTimer timeOutTimer; bool isResponseCompressionEnabled; bool isRequestCompressionEnabled; + int httpResponseCode; + void on_manager_timeout(QNetworkReply *reply); void process_response(QNetworkReply *reply); QByteArray decompress(const QByteArray& data); - QByteArray compress(const QByteArray& input, int level, PFXCompressionType compressType); + QByteArray compress(const QByteArray& input, int level, PFXCompressionType compressType); + private slots: void on_manager_finished(QNetworkReply *reply); }; From 45bbe4922b7a8370988b1291d6a68384a88dde5a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 24 Apr 2020 23:41:42 +0800 Subject: [PATCH 14/25] Add test for allOf without object type (#6042) * add test for allof without object type * add comments to test cases --- .../org/openapitools/codegen/DefaultCodegenTest.java | 8 ++++++++ .../src/test/resources/3_0/allOf_composition.yaml | 10 ++++++++++ 2 files changed, 18 insertions(+) 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 93ddc121df..28fff725bb 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 @@ -611,15 +611,23 @@ public class DefaultCodegenTest { codegen.setOpenAPI(openAPI); + // to test allOf with double refs Schema supermanSchema = openAPI.getComponents().getSchemas().get("SuperMan"); CodegenModel supermanModel = codegen.fromModel("SuperMan", supermanSchema); Assert.assertEquals(supermanModel.parent, null); Assert.assertEquals(supermanModel.allParents, null); + // to test allOf with single ref Schema superboySchema = openAPI.getComponents().getSchemas().get("SuperBoy"); CodegenModel superboyModel = codegen.fromModel("SuperBoy", superboySchema); Assert.assertEquals(superboyModel.parent, null); Assert.assertEquals(superboyModel.allParents, null); + + // to test allOf with single ref and no "type: object" in the (last) inline schema + Schema superbabySchema = openAPI.getComponents().getSchemas().get("SuperBaby"); + CodegenModel superbabyModel = codegen.fromModel("SuperBaby", superbabySchema); + Assert.assertEquals(superbabyModel.parent, null); + Assert.assertEquals(superbabyModel.allParents, null); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf_composition.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf_composition.yaml index 89f132c1ef..3b2c6a1be5 100644 --- a/modules/openapi-generator/src/test/resources/3_0/allOf_composition.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/allOf_composition.yaml @@ -26,6 +26,16 @@ paths: $ref: "#/components/schemas/SuperMan" components: schemas: + SuperBaby: # to test single ref (Human) only + allOf: + - $ref: '#/components/schemas/Human' + - required: # without type: object + - level + properties: + gender: + type: string + age: + type: integer SuperBoy: # to test single ref (Human) only allOf: - $ref: '#/components/schemas/Human' From 8e8471c1fd6a25b032dcf3ba43968777d59b7322 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 24 Apr 2020 09:01:02 -0700 Subject: [PATCH 15/25] [CORE] Fixes composed schema discriminator map (#4906) * Adds addComposedMappedModels and testComposedSchemaOneOfDiscriminatorMap * Requires that discriminators be required properties * Strengthens discriminaotr validation, adds better error messages, adds schema oneof samples * Adds oneOf and anyOf invalidDiscriminator tests * Updates incorrect addOneOfInterfaceModel invocation * Runs ensure-up-to-date * Adds updates from Sebastien Rosset * Removes newlines * Uses df.isString * Fixes tests be correctly setting df.isString * Updates discriminatorExplicitMappingVerbose description per PR feedback * Adds description of how mappedModels is populated * Adds the suggestion exception raising when a MappedModel mappingName is null * Actually resolves merge conflicts * Switches two methods to package private because they are needed for testing * Allow nulls in MappedModel.getMappingName * Updates CLI flag name to legacyDiscriminatorBehavior, default=true Co-authored-by: William Cheng --- docs/generators/ada-server.md | 10 + docs/generators/ada.md | 10 + docs/generators/android.md | 10 + docs/generators/apache2.md | 10 + docs/generators/apex.md | 10 + docs/generators/asciidoc.md | 10 + docs/generators/avro-schema.md | 10 + docs/generators/bash.md | 10 + docs/generators/c.md | 10 + docs/generators/clojure.md | 10 + docs/generators/cpp-qt5-client.md | 10 + docs/generators/cpp-qt5-qhttpengine-server.md | 10 + docs/generators/cpp-tizen.md | 10 + docs/generators/cwiki.md | 10 + docs/generators/dart-dio.md | 10 + docs/generators/dart-jaguar.md | 10 + docs/generators/dart.md | 10 + docs/generators/dynamic-html.md | 10 + docs/generators/elixir.md | 10 + docs/generators/fsharp-functions.md | 10 + docs/generators/groovy.md | 10 + docs/generators/haskell-http-client.md | 10 + docs/generators/haskell.md | 10 + docs/generators/html.md | 10 + docs/generators/html2.md | 10 + docs/generators/java-inflector.md | 10 + docs/generators/java-msf4j.md | 10 + docs/generators/java-pkmst.md | 10 + docs/generators/java-play-framework.md | 10 + docs/generators/java-undertow-server.md | 10 + docs/generators/java-vertx-web.md | 10 + docs/generators/java-vertx.md | 10 + docs/generators/java.md | 10 + docs/generators/javascript-apollo.md | 10 + docs/generators/javascript-closure-angular.md | 10 + docs/generators/javascript-flowtyped.md | 10 + docs/generators/javascript.md | 10 + docs/generators/jaxrs-cxf-cdi.md | 10 + docs/generators/jaxrs-cxf-client.md | 10 + docs/generators/jaxrs-cxf-extended.md | 10 + docs/generators/jaxrs-cxf.md | 10 + docs/generators/jaxrs-jersey.md | 10 + docs/generators/jaxrs-resteasy-eap.md | 10 + docs/generators/jaxrs-resteasy.md | 10 + docs/generators/jaxrs-spec.md | 10 + docs/generators/jmeter.md | 10 + docs/generators/k6.md | 10 + docs/generators/markdown.md | 10 + docs/generators/nim.md | 10 + docs/generators/nodejs-express-server.md | 10 + docs/generators/nodejs-server-deprecated.md | 10 + docs/generators/ocaml.md | 10 + docs/generators/openapi-yaml.md | 10 + docs/generators/openapi.md | 10 + docs/generators/php-laravel.md | 10 + docs/generators/php-lumen.md | 10 + docs/generators/php-silex.md | 10 + docs/generators/php-slim-deprecated.md | 10 + docs/generators/php-slim4.md | 10 + docs/generators/php-symfony.md | 10 + docs/generators/php-ze-ph.md | 10 + docs/generators/php.md | 10 + docs/generators/python-aiohttp.md | 10 + docs/generators/python-blueplanet.md | 10 + docs/generators/python-flask.md | 10 + docs/generators/ruby.md | 10 + docs/generators/scala-akka-http-server.md | 10 + docs/generators/scala-akka.md | 10 + docs/generators/scala-gatling.md | 10 + .../generators/scala-httpclient-deprecated.md | 10 + docs/generators/scala-lagom-server.md | 10 + docs/generators/scala-play-server.md | 10 + docs/generators/scala-sttp.md | 10 + docs/generators/scalatra.md | 10 + docs/generators/scalaz.md | 10 + docs/generators/spring.md | 10 + docs/generators/swift2-deprecated.md | 10 + docs/generators/swift3-deprecated.md | 10 + docs/generators/swift4.md | 10 + docs/generators/swift5.md | 10 + docs/generators/typescript-angular.md | 10 + docs/generators/typescript-angularjs.md | 10 + docs/generators/typescript-aurelia.md | 10 + docs/generators/typescript-axios.md | 10 + docs/generators/typescript-fetch.md | 10 + docs/generators/typescript-inversify.md | 10 + docs/generators/typescript-jquery.md | 10 + docs/generators/typescript-node.md | 10 + docs/generators/typescript-redux-query.md | 10 + docs/generators/typescript-rxjs.md | 10 + .../openapitools/codegen/cmd/Generate.java | 3 + .../codegen/CodegenConstants.java | 13 + .../codegen/CodegenDiscriminator.java | 56 +- .../openapitools/codegen/CodegenModel.java | 11 + .../openapitools/codegen/CodegenProperty.java | 5 +- .../openapitools/codegen/DefaultCodegen.java | 391 +++++++++++- .../codegen/DefaultGenerator.java | 4 +- .../GoClientExperimentalCodegen.java | 1 + .../PythonClientExperimentalCodegen.java | 2 + .../src/main/resources/Java/pojo.mustache | 2 +- .../main/resources/python/api_client.mustache | 9 +- .../src/main/resources/python/model.mustache | 5 +- .../model_templates/classvars.mustache | 16 +- .../codegen/DefaultCodegenTest.java | 578 +++++++++++++++++- .../options/BashClientOptionsProvider.java | 1 + .../options/DartClientOptionsProvider.java | 1 + .../options/DartDioClientOptionsProvider.java | 1 + .../options/ElixirClientOptionsProvider.java | 1 + .../HaskellServantOptionsProvider.java | 1 + .../options/PhpClientOptionsProvider.java | 1 + .../PhpLumenServerOptionsProvider.java | 1 + .../PhpSilexServerOptionsProvider.java | 1 + .../PhpSlim4ServerOptionsProvider.java | 1 + .../options/PhpSlimServerOptionsProvider.java | 1 + .../options/RubyClientOptionsProvider.java | 1 + .../ScalaAkkaClientOptionsProvider.java | 1 + .../ScalaHttpClientOptionsProvider.java | 1 + .../options/Swift3OptionsProvider.java | 1 + .../options/Swift4OptionsProvider.java | 1 + .../options/Swift5OptionsProvider.java | 1 + ...ypeScriptAngularClientOptionsProvider.java | 1 + ...eScriptAngularJsClientOptionsProvider.java | 1 + ...ypeScriptAureliaClientOptionsProvider.java | 1 + .../TypeScriptFetchClientOptionsProvider.java | 1 + .../TypeScriptNodeClientOptionsProvider.java | 1 + .../codegen/ruby/RubyClientCodegenTest.java | 28 +- ...ith-fake-endpoints-models-for-testing.yaml | 3 +- .../resources/2_0/x-discriminator-value.yaml | 66 ++ .../3_0/allOf_composition_discriminator.yaml | 103 ++++ .../resources/3_0/anyOfDiscriminator.yaml | 244 ++++++++ .../resources/3_0/oneOfDiscriminator.yaml | 268 ++++++++ .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../org/openapitools/client/model/Animal.java | 2 +- .../python-asyncio/petstore_api/api_client.py | 9 +- .../petstore_api/models/animal.py | 11 +- .../petstore_api/models/cat.py | 19 +- .../petstore_api/models/child_cat.py | 19 +- .../petstore_api/models/child_dog.py | 19 +- .../petstore_api/models/child_lizard.py | 19 +- .../petstore_api/models/dog.py | 19 +- .../petstore_api/models/grandparent_animal.py | 43 +- .../petstore_api/models/parent_pet.py | 13 +- .../python-tornado/petstore_api/api_client.py | 9 +- .../python/petstore_api/api_client.py | 9 +- .../petstore_api/models/animal.py | 11 +- .../petstore_api/models/cat.py | 19 +- .../petstore_api/models/dog.py | 19 +- .../petstore_api/models/mammal.py | 11 +- .../python/petstore_api/api_client.py | 9 +- 171 files changed, 2907 insertions(+), 128 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/2_0/x-discriminator-value.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/anyOfDiscriminator.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/oneOfDiscriminator.yaml diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 9a86032ec7..7f804ddf0d 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -7,6 +7,16 @@ sidebar_label: ada-server | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 2b382b4c4f..c5d73461dc 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -7,6 +7,16 @@ sidebar_label: ada | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/android.md b/docs/generators/android.md index 4eeeec214b..430500d9e6 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -15,6 +15,16 @@ sidebar_label: android |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |groupId|groupId for use in the generated build.gradle and pom.xml| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template) to use|
    **volley**
    HTTP client: Volley 1.0.19 (default)
    **httpclient**
    HTTP client: Apache HttpClient 4.3.6. JSON processing: Gson 2.3.1. IMPORTANT: Android client using HttpClient is not actively maintained and will be depecreated in the next major release.
    |null| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index cfa9756c7d..8b92e02dd1 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -7,6 +7,16 @@ sidebar_label: apache2 | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/apex.md b/docs/generators/apex.md index 06c54e3b97..80ac5bd24f 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -10,6 +10,16 @@ sidebar_label: apex |buildMethod|The build method for this package.| |null| |classPrefix|Prefix for generated classes. Set this to avoid overwriting existing classes in your org.| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |namedCredential|The named credential name for the HTTP callouts| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 66a175518b..777a62080c 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -16,6 +16,16 @@ sidebar_label: asciidoc |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 13ca849949..6f0621b747 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -7,6 +7,16 @@ sidebar_label: avro-schema | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |packageName|package for generated classes (where supported)| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/bash.md b/docs/generators/bash.md index b91eb990a6..3d626eff72 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -13,6 +13,16 @@ sidebar_label: bash |generateBashCompletion|Whether to generate the Bash completion script| |false| |generateZshCompletion|Whether to generate the Zsh completion script| |false| |hostEnvironmentVariable|Name of environment variable where host can be defined (e.g. PETSTORE_HOST='http://api.openapitools.org:8080')| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |processMarkdown|Convert all Markdown Markup into terminal formatting| |false| |scriptName|The name of the script that will be generated (e.g. petstore-cli)| |null| diff --git a/docs/generators/c.md b/docs/generators/c.md index ee9b258669..8ebc3221fa 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -8,6 +8,16 @@ sidebar_label: c |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index b2f3a6a4d9..e42936d9f8 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -8,6 +8,16 @@ sidebar_label: clojure |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |baseNamespace|the base/top namespace (Default: generated from projectName)| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| |projectLicenseName|name of the license the project uses (Default: using info.license.name or not included in project.clj)| |null| diff --git a/docs/generators/cpp-qt5-client.md b/docs/generators/cpp-qt5-client.md index bc55db1452..9a043e5323 100644 --- a/docs/generators/cpp-qt5-client.md +++ b/docs/generators/cpp-qt5-client.md @@ -9,6 +9,16 @@ sidebar_label: cpp-qt5-client |contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/cpp-qt5-qhttpengine-server.md b/docs/generators/cpp-qt5-qhttpengine-server.md index 2b2cd4e9f1..574a019f13 100644 --- a/docs/generators/cpp-qt5-qhttpengine-server.md +++ b/docs/generators/cpp-qt5-qhttpengine-server.md @@ -9,6 +9,16 @@ sidebar_label: cpp-qt5-qhttpengine-server |contentCompression|Enable Compressed Content Encoding for requests and responses| |false| |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index f805721b57..16022f8f53 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -7,6 +7,16 @@ sidebar_label: cpp-tizen | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index f2d5342f8f..bf7949015b 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -15,6 +15,16 @@ sidebar_label: cwiki |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 05514b9a1e..fd16331b9a 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -9,6 +9,16 @@ sidebar_label: dart-dio |browserClient|Is the client browser based (for Dart 1.x only)| |null| |dateLibrary|Option. Date library to use|
    **core**
    Dart core library (DateTime)
    **timemachine**
    Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
    |core| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |nullableFields|Is the null fields should be in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 5e81f82025..995676b9a1 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -8,6 +8,16 @@ sidebar_label: dart-jaguar |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |browserClient|Is the client browser based (for Dart 1.x only)| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |nullableFields|Is the null fields should be in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index 993c31cf44..7cad220b66 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -8,6 +8,16 @@ sidebar_label: dart |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |browserClient|Is the client browser based (for Dart 1.x only)| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| |pubAuthorEmail|Email address of the author in generated pubspec| |null| diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index b252e414bd..6d120dd987 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -11,6 +11,16 @@ sidebar_label: dynamic-html |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |groupId|groupId in generated pom.xml| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index 14afa95bc9..9dc1c27d18 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -8,6 +8,16 @@ sidebar_label: elixir |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay.Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseHeader|The license header to prepend to the top of all source files.| |null| |packageName|Elixir package name (convention: lowercase).| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index a7e28602b3..456a7daaa4 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -7,6 +7,16 @@ sidebar_label: fsharp-functions | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |NoLicense| |licenseUrl|The URL of the license| |http://localhost| |packageAuthors|Specifies Authors property in the .NET Core project file.| |OpenAPI| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 32699d5a12..dbdec26031 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -25,6 +25,16 @@ sidebar_label: groovy |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 41163e8fa8..9b9a848ae6 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -24,6 +24,16 @@ sidebar_label: haskell-http-client |generateModelConstructors|Generate smart constructors (only supply required fields) for models| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |inlineMimeTypes|Inline (hardcode) the content-type and accept parameters on operations, when there is only 1 option| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelDeriving|Additional classes to include in the deriving() clause of Models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |requestType|Set the name of the type used to generate requests| |null| diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 2e35a073d8..6bb19ea0f8 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -8,6 +8,16 @@ sidebar_label: haskell |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |apiPackage|package for generated api classes| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serveStatic|serve will serve files from the directory 'static'.| |true| diff --git a/docs/generators/html.md b/docs/generators/html.md index 78cef65b33..dd8c9fa9d6 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -15,6 +15,16 @@ sidebar_label: html |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/html2.md b/docs/generators/html2.md index 51d39c72a7..7201bdc249 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -15,6 +15,16 @@ sidebar_label: html2 |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseInfo|a short description of the license| |null| |licenseUrl|a URL pointing to the full license| |null| |packageName|C# package name| |null| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index f34df4d7a1..4d9c6bfe7e 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -27,6 +27,16 @@ sidebar_label: java-inflector |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.controllers| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index 27017264e1..bedc76b14d 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -28,6 +28,16 @@ sidebar_label: java-msf4j |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index c8df6eb887..95b92bbb11 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -29,6 +29,16 @@ sidebar_label: java-pkmst |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |com.prokarma.pkmst.controller| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |com.prokarma.pkmst.model| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index 3066a14a72..6801838e4a 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -31,6 +31,16 @@ sidebar_label: java-play-framework |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |apimodels| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 34544a236c..94bf4e39cc 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -27,6 +27,16 @@ sidebar_label: java-undertow-server |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.handler| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |null| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index cd6c3ee4e9..a3fff51038 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -27,6 +27,16 @@ sidebar_label: java-vertx-web |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.vertxweb.server| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.vertxweb.server.model| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 58c68915ad..13e7bb94c4 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -27,6 +27,16 @@ sidebar_label: java-vertx |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.server.api.model| diff --git a/docs/generators/java.md b/docs/generators/java.md index 8cdcd9dc4e..289ad44050 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -29,6 +29,16 @@ sidebar_label: java |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template) to use|
    **jersey1**
    HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libaries instead.
    **jersey2**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **jersey2-experimental**
    HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
    **feign**
    HTTP client: OpenFeign 9.x (deprecated) or 10.x (default). JSON processing: Jackson 2.9.x.
    **okhttp-gson**
    [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
    **retrofit**
    HTTP client: OkHttp 2.x. JSON processing: Gson 2.x (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead.
    **retrofit2**
    HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)
    **resttemplate**
    HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
    **webclient**
    HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
    **resteasy**
    HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
    **vertx**
    HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
    **google-api-client**
    HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
    **rest-assured**
    HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
    **native**
    HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
    **microprofile**
    HTTP client: Microprofile client X.x. JSON processing: Jackson 2.9.x
    |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 44cad073fd..51a0421dcd 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -11,6 +11,16 @@ sidebar_label: javascript-apollo |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|name of the license the project uses (Default: using info.license.name)| |null| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 89b3bd9b0f..4cf42f33a9 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -8,6 +8,16 @@ sidebar_label: javascript-closure-angular |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 6ecd6654d1..8efe8bba9b 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -9,6 +9,16 @@ sidebar_label: javascript-flowtyped |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index 1181fffa50..139499823d 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -12,6 +12,16 @@ sidebar_label: javascript |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|name of the license the project uses (Default: using info.license.name)| |null| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index ccd6d823c1..13378c2144 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -31,6 +31,16 @@ sidebar_label: jaxrs-cxf-cdi |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    |<default>| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 0d1c841f15..052caa1f29 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -27,6 +27,16 @@ sidebar_label: jaxrs-cxf-client |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index b83a1d55e4..28756d164f 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -34,6 +34,16 @@ sidebar_label: jaxrs-cxf-extended |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |loadTestDataFromFile|Load test data from a generated JSON file| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index d3dd5e4482..343374b3c2 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -33,6 +33,16 @@ sidebar_label: jaxrs-cxf |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 9183a75d65..ef5a852acf 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -28,6 +28,16 @@ sidebar_label: jaxrs-jersey |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template)|
    **jersey1**
    Jersey core 1.x
    **jersey2**
    Jersey core 2.x
    |jersey2| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index 3a7623db67..1d5f312382 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -29,6 +29,16 @@ sidebar_label: jaxrs-resteasy-eap |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index 724c15e928..60e52043dc 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -29,6 +29,16 @@ sidebar_label: jaxrs-resteasy |implFolder|folder for generated implementation code| |src/main/java| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |modelPackage|package for generated models| |org.openapitools.model| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3bd0accada..98cbb0c96c 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -31,6 +31,16 @@ sidebar_label: jaxrs-spec |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|library template (sub-template)|
    **<default>**
    JAXRS spec only, to be deployed in an app server (TomEE, JBoss, WLS, ...)
    **quarkus**
    Server using Quarkus
    **thorntail**
    Server using Thorntail
    **openliberty**
    Server using Open Liberty
    **helidon**
    Server using Helidon
    |<default>| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 142f826d79..e8cbb38e5f 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -7,6 +7,16 @@ sidebar_label: jmeter | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 4ff51c7527..2f6d321b14 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -7,6 +7,16 @@ sidebar_label: k6 | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 2cba7bc698..465504f694 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -7,6 +7,16 @@ sidebar_label: markdown | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 61ba1d00f1..0340561b62 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -7,6 +7,16 @@ sidebar_label: nim | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index 76b0893f9a..8cc7b8af1f 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -7,6 +7,16 @@ sidebar_label: nodejs-express-server | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nodejs-server-deprecated.md b/docs/generators/nodejs-server-deprecated.md index 84a3b13194..b2b09ce303 100644 --- a/docs/generators/nodejs-server-deprecated.md +++ b/docs/generators/nodejs-server-deprecated.md @@ -9,6 +9,16 @@ sidebar_label: nodejs-server-deprecated |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |exportedName|When the generated code will be deployed to Google Cloud Functions, this option can be used to update the name of the exported function. By default, it refers to the basePath. This does not affect normal standalone nodejs server code.| |null| |googleCloudFunctions|When specified, it will generate the code which runs within Google Cloud Functions instead of standalone Node.JS server. See https://cloud.google.com/functions/docs/quickstart for the details of how to deploy the generated code.| |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index d8cda30ed8..ab9a3bd7fd 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -7,6 +7,16 @@ sidebar_label: ocaml | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index 7eda9d44be..3d7b5af160 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -7,6 +7,16 @@ sidebar_label: openapi-yaml | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |outputFile|Output filename| |openapi/openapi.yaml| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index 5d46dccf4f..7625d70cb8 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -7,6 +7,16 @@ sidebar_label: openapi | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index 57b9191b60..e2bbcaaab0 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -10,6 +10,16 @@ sidebar_label: php-laravel |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 2414dda65c..1e69867a13 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -10,6 +10,16 @@ sidebar_label: php-lumen |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-silex.md b/docs/generators/php-silex.md index 81f5e6cb38..2557c8f151 100644 --- a/docs/generators/php-silex.md +++ b/docs/generators/php-silex.md @@ -7,6 +7,16 @@ sidebar_label: php-silex | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |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| diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index 98381616b9..16b5a34e76 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -10,6 +10,16 @@ sidebar_label: php-slim-deprecated |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index b0e79e02ae..86f9a6efbc 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -10,6 +10,16 @@ sidebar_label: php-slim4 |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 1d3e71d392..e645d1c0a2 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -15,6 +15,16 @@ sidebar_label: php-symfony |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |phpLegacySupport|Should the generated code be compatible with PHP 5.x?| |true| diff --git a/docs/generators/php-ze-ph.md b/docs/generators/php-ze-ph.md index 93a1d3f6ad..6afc5d2a29 100644 --- a/docs/generators/php-ze-ph.md +++ b/docs/generators/php-ze-ph.md @@ -10,6 +10,16 @@ sidebar_label: php-ze-ph |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php.md b/docs/generators/php.md index 413996804e..ba90aa92d7 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -11,6 +11,16 @@ sidebar_label: php |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |packageName|The main package name for classes. e.g. GeneratedPetstore| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index ee337d2e5b..0904e15e29 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -9,6 +9,16 @@ sidebar_label: python-aiohttp |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 0382237eef..ba1613ebe2 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -9,6 +9,16 @@ sidebar_label: python-blueplanet |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index c8ab554ade..a09e1dd889 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -9,6 +9,16 @@ sidebar_label: python-flask |controllerPackage|controller package| |controllers| |defaultController|default controller| |default_controller| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 2475a797ec..9bc917daa9 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -17,6 +17,16 @@ sidebar_label: ruby |gemSummary|gem summary. | |A ruby wrapper for the REST APIs| |gemVersion|gem version.| |1.0.0| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |library|HTTP library template (sub-template) to use|
    **faraday**
    Faraday (https://github.com/lostisland/faraday) (Beta support)
    **typhoeus**
    Typhoeus >= 1.0.1 (https://github.com/typhoeus/typhoeus)
    |typhoeus| |moduleName|top module name (convention: CamelCase, usually corresponding to gem name).| |OpenAPIClient| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index ecd656979e..5b293ffbc3 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -14,6 +14,16 @@ sidebar_label: scala-akka-http-server |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |groupId|groupId in generated pom.xml| |org.openapitools| |invokerPackage|root package for generated code| |org.openapitools.server| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index ad8c5d485c..d023156775 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -9,6 +9,16 @@ sidebar_label: scala-akka |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 0e1e748245..1b711480df 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -9,6 +9,16 @@ sidebar_label: scala-gatling |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index febeca9a69..a6ee24cc44 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -9,6 +9,16 @@ sidebar_label: scala-httpclient-deprecated |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 99b43af7d5..da97ad1ee7 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -9,6 +9,16 @@ sidebar_label: scala-lagom-server |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 57bdf5d70e..ef8b2db4e7 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -10,6 +10,16 @@ sidebar_label: scala-play-server |basePackage|Base package in which supporting classes are generated.| |org.openapitools| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |generateCustomExceptions|If set, generates custom exception types.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 5c277bf9dc..2d1584633b 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -9,6 +9,16 @@ sidebar_label: scala-sttp |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index af71e32aa4..bb05a8f35e 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -9,6 +9,16 @@ sidebar_label: scalatra |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index aa2f6121ca..48ecb1bdfa 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -9,6 +9,16 @@ sidebar_label: scalaz |apiPackage|package for generated api classes| |null| |dateLibrary|Option. Date library to use|
    **joda**
    Joda (for legacy app)
    **java8**
    Java 8 native JSR310 (prefered for JDK 1.8+)
    |java8| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 98b896d8f2..c2a43de8ce 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -35,6 +35,16 @@ sidebar_label: spring |interfaceOnly|Whether to generate only API interface stubs without the server files.| |false| |invokerPackage|root package for generated code| |org.openapitools.api| |java8|Option. Use Java8 classes instead of third party equivalents|
    **true**
    Use Java 8 classes such as Base64. Use java8 default interface when a responseWrapper is used
    **false**
    Various third party libraries as needed
    |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |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| diff --git a/docs/generators/swift2-deprecated.md b/docs/generators/swift2-deprecated.md index fe739bc109..34894b8930 100644 --- a/docs/generators/swift2-deprecated.md +++ b/docs/generators/swift2-deprecated.md @@ -8,6 +8,16 @@ sidebar_label: swift2-deprecated |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |podAuthors|Authors used for Podspec| |null| |podDescription|Description used for Podspec| |null| |podDocsetURL|Docset URL used for Podspec| |null| diff --git a/docs/generators/swift3-deprecated.md b/docs/generators/swift3-deprecated.md index 7f1997eaef..ed484208b2 100644 --- a/docs/generators/swift3-deprecated.md +++ b/docs/generators/swift3-deprecated.md @@ -8,6 +8,16 @@ sidebar_label: swift3-deprecated |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| |objcCompatible|Add additional properties and methods for Objective-C compatibility (default: false)| |null| |podAuthors|Authors used for Podspec| |null| diff --git a/docs/generators/swift4.md b/docs/generators/swift4.md index f4c589c02e..4030c9a11f 100644 --- a/docs/generators/swift4.md +++ b/docs/generators/swift4.md @@ -8,6 +8,16 @@ sidebar_label: swift4 |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |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| diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 52a75bd93b..c7beb3e39a 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -9,6 +9,16 @@ sidebar_label: swift5 |apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| |library|Library template (sub-template) to use|
    **urlsession**
    [DEFAULT] HTTP client: URLSession
    **alamofire**
    HTTP client: Alamofire
    |urlsession| |nonPublicApi|Generates code with reduced access modifiers; allows embedding elsewhere without exposing non-public API calls to consumers.(default: false)| |null| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index f382194df4..4d9191a91f 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -11,6 +11,16 @@ sidebar_label: typescript-angular |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |modelSuffix|The suffix of the generated model.| |null| diff --git a/docs/generators/typescript-angularjs.md b/docs/generators/typescript-angularjs.md index fbfd828ba3..0c5f755640 100644 --- a/docs/generators/typescript-angularjs.md +++ b/docs/generators/typescript-angularjs.md @@ -9,6 +9,16 @@ sidebar_label: typescript-angularjs |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index 955079117b..f5f0e764b6 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -9,6 +9,16 @@ sidebar_label: typescript-aurelia |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmVersion|The version of your npm package. If not provided, using the version from the OpenAPI specification file.| |1.0.0| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 5e65684a0e..575d2e17bb 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -9,6 +9,16 @@ sidebar_label: typescript-axios |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index 40e7ff4eb2..2662e2adef 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -9,6 +9,16 @@ sidebar_label: typescript-fetch |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 5d68c9f083..6829b64eee 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -9,6 +9,16 @@ sidebar_label: typescript-inversify |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index 91d61cf31e..262578ce20 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -10,6 +10,16 @@ sidebar_label: typescript-jquery |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index d4bdee29bc..06a4853986 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -9,6 +9,16 @@ sidebar_label: typescript-node |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index e5674a4c30..14fbe4c854 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -9,6 +9,16 @@ sidebar_label: typescript-redux-query |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 9a210f4934..e9638e2fbd 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -9,6 +9,16 @@ sidebar_label: typescript-rxjs |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names. A special 'v4-compat' value enables the backward-compatible behavior (as pre v4.2.3)| |v4-compat| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|legacyDiscriminatorBehavior|This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. + +When this flag is set to 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. +- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing. +When this flag is set to true: + +- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. +Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}.| |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url your private npmRepo in the package.json| |null| diff --git a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java index e40f3c624a..084026f555 100644 --- a/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java +++ b/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java @@ -240,6 +240,9 @@ public class Generate extends OpenApiGeneratorCommand { @Option(name = {"--generate-alias-as-model"}, title = "generate alias (array, map) as model", description = CodegenConstants.GENERATE_ALIAS_AS_MODEL_DESC) private Boolean generateAliasAsModel; + @Option(name = {"--legacy-discriminator-behavior"}, title = "Support legacy logic for evaluating discriminators", description = CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC) + private Boolean legacyDiscriminatorBehavior; + @Option(name = {"--minimal-update"}, title = "Minimal update", description = "Only write output files that have changed.") 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 14e1fe5fce..5b2cc91645 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 @@ -351,4 +351,17 @@ public class CodegenConstants { public static final String REMOVE_ENUM_VALUE_PREFIX = "removeEnumValuePrefix"; public static final String REMOVE_ENUM_VALUE_PREFIX_DESC = "Remove the common prefix of enum values"; + + public static final String LEGACY_DISCRIMINATOR_BEHAVIOR = "legacyDiscriminatorBehavior"; + public static final String LEGACY_DISCRIMINATOR_BEHAVIOR_DESC = "This flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName.\n" + + "\n" + + "When this flag is set to false:\n" + + "\n" + + "- 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.\n" + + "- Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.\n" + + "When this flag is set to true:\n" + + "\n" + + "- The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.\n" + + "Note to developers supporting a language generator in OpenAPITools: to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}."; + } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java index 73d85052e7..4e30df0c9e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenDiscriminator.java @@ -7,12 +7,39 @@ import java.util.Map; import java.util.Objects; import java.util.Set; +/** + * This class encapsulates the OpenAPI discriminator construct, as specified at + * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#discriminatorObject. + * + * When request bodies or response payloads may be one of a number of different schemas, + * a discriminator object can be used to aid in serialization, deserialization, and validation. + * The discriminator is a specific object in a schema which is used to inform the consumer of + * the specification of an alternative schema based on the value associated with it. + */ public class CodegenDiscriminator { + // The name of the property in the payload that will hold the discriminator value. + // This is the propertyName as specified in the OpenAPI discriminator object. private String propertyName; private String propertyBaseName; private String propertyGetter; private String propertyType; private Map mapping; + + // mappedModels is populated differently if discriminatorExplicitMappingVerbose is + // True or False. When: + // + // discriminatorExplicitMappingVerbose == False, this contains: + // - the name to schema map info in the discriminator mapping entry in your openapi spec OR + // - child schemas that allOf inherit self schema + // + // discriminatorExplicitMappingVerbose == True, this contains: + // - the name to schema map info in the discriminMappedModelator mapping entry in your openapi spec AND + // - x-discriminator-value mappings in child oneOf + anyOf schemas + descendant schemas that allOf inherit self schema AND + // - descendant schemas that allOf inherit self schema AND + // - child oneOf + anyOf schemas + // + // see the method createDiscriminator in DefaultCodegen.java + private Set mappedModels = new LinkedHashSet<>(); public String getPropertyName() { @@ -63,8 +90,21 @@ public class CodegenDiscriminator { this.mappedModels = mappedModels; } - public static class MappedModel { + /** + * An object to hold discriminator mappings between payload values and schema names or + * references. + * + * In the OpenAPI document, the discriminator "mapping" attribute is optional. + * In scenarios where the value of the discriminator field does not match the schema name + * or implicit mapping is not possible, an optional mapping definition MAY be used. + * In OpenAPITools codegen, the MappedModel is the union of all the discriminator mappings, + * both explicitly defined in the OpenAPI document and inherited from oneOf/allOf/anyOf. + */ + public static class MappedModel implements Comparable{ + // The value of the discriminator property in the payload. private String mappingName; + // The OAS schema name. It is obtained from the OAS document, and the string value + // is converted to a sanitized, internal representation within codegen. private String modelName; public MappedModel(String mappingName, String modelName) { @@ -72,6 +112,18 @@ public class CodegenDiscriminator { this.modelName = modelName; } + @Override + public int compareTo(MappedModel other) { + if (getMappingName() == null && other.getMappingName() == null) { + return 0; + } else if (getMappingName() == null) { + return 1; + } else if (other.getMappingName() == null) { + return -1; + } + return getMappingName().compareTo(other.getMappingName()); + } + public String getMappingName() { return mappingName; } @@ -130,4 +182,4 @@ public class CodegenDiscriminator { sb.append('}'); return sb.toString(); } -} +} \ No newline at end of file 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 16a296f84e..e9d25fd5ca 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 @@ -696,6 +696,17 @@ public class CodegenModel implements IJsonSchemaValidationProperties { return sb.toString(); } + public void addDiscriminatorMappedModelsImports(){ + if (discriminator == null || discriminator.getMappedModels() == null) { + return; + } + for (CodegenDiscriminator.MappedModel mm : discriminator.getMappedModels()) { + if (!"".equals(mm.getModelName())) { + imports.add(mm.getModelName()); + } + } + } + public boolean isEmptyVars() { return emptyVars; } 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 b6255e1fe0..bc1101c015 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 @@ -150,6 +150,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public boolean isNullable; public boolean isSelfReference; public boolean isCircularReference; + public boolean isDiscriminator; public List _enum; public Map allowableValues; public CodegenProperty items; @@ -651,6 +652,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", isNullable=").append(isNullable); sb.append(", isSelfReference=").append(isSelfReference); sb.append(", isCircularReference=").append(isCircularReference); + sb.append(", isDiscriminator=").append(isDiscriminator); sb.append(", _enum=").append(_enum); sb.append(", allowableValues=").append(allowableValues); sb.append(", items=").append(items); @@ -717,6 +719,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti isNullable == that.isNullable && isSelfReference == that.isSelfReference && isCircularReference == that.isCircularReference && + isDiscriminator == that.isDiscriminator && hasValidation == that.hasValidation && isInherited == that.isInherited && isXmlAttribute == that.isXmlAttribute && @@ -775,7 +778,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isListContainer, isMapContainer, isEnum, isReadOnly, isWriteOnly, isNullable, - isSelfReference, isCircularReference, _enum, allowableValues, items, mostInnerItems, + isSelfReference, isCircularReference, isDiscriminator, _enum, allowableValues, items, mostInnerItems, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase, nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace, isXmlWrapped); 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 6f5990074c..91edad3cd5 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 @@ -215,6 +215,9 @@ public class DefaultCodegen implements CodegenConfig { // flag to indicate whether enum value prefixes are removed protected boolean removeEnumValuePrefix = true; + // Support legacy logic for evaluating discriminators + protected boolean legacyDiscriminatorBehavior = true; + // make openapi available to all methods protected OpenAPI openAPI; @@ -306,6 +309,11 @@ public class DefaultCodegen implements CodegenConfig { this.setRemoveEnumValuePrefix(Boolean.valueOf(additionalProperties .get(CodegenConstants.REMOVE_ENUM_VALUE_PREFIX).toString())); } + + if (additionalProperties.containsKey(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR)) { + this.setLegacyDiscriminatorBehavior(Boolean.valueOf(additionalProperties + .get(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR).toString())); + } } /*** @@ -468,7 +476,8 @@ public class DefaultCodegen implements CodegenConfig { } parent.getChildren().add(cm); parent.hasChildren = true; - if (parent.getDiscriminator() == null) { + Schema parentSchema = this.openAPI.getComponents().getSchemas().get(parent.name); + if (parentSchema.getDiscriminator() == null) { parent = allModels.get(parent.getParent()); } else { parent = null; @@ -765,7 +774,7 @@ public class DefaultCodegen implements CodegenConfig { if (e.getKey().contains("/")) { // if this is property schema, we also need to generate the oneOf interface model addOneOfNameExtension((ComposedSchema) s, nOneOf); - addOneOfInterfaceModel((ComposedSchema) s, nOneOf); + addOneOfInterfaceModel((ComposedSchema) s, nOneOf, openAPI); } else { // else this is a component schema, so we will just use that as the oneOf interface model addOneOfNameExtension((ComposedSchema) s, n); @@ -774,13 +783,13 @@ public class DefaultCodegen implements CodegenConfig { Schema items = ((ArraySchema) s).getItems(); if (ModelUtils.isComposedSchema(items)) { addOneOfNameExtension((ComposedSchema) items, nOneOf); - addOneOfInterfaceModel((ComposedSchema) items, nOneOf); + addOneOfInterfaceModel((ComposedSchema) items, nOneOf, openAPI); } } else if (ModelUtils.isMapSchema(s)) { Schema addProps = ModelUtils.getAdditionalProperties(s); if (addProps != null && ModelUtils.isComposedSchema(addProps)) { addOneOfNameExtension((ComposedSchema) addProps, nOneOf); - addOneOfInterfaceModel((ComposedSchema) addProps, nOneOf); + addOneOfInterfaceModel((ComposedSchema) addProps, nOneOf, openAPI); } } } @@ -1109,6 +1118,14 @@ public class DefaultCodegen implements CodegenConfig { this.ensureUniqueParams = ensureUniqueParams; } + public Boolean getLegacyDiscriminatorBehavior() { + return legacyDiscriminatorBehavior; + } + + public void setLegacyDiscriminatorBehavior(boolean val){ + this.legacyDiscriminatorBehavior = val; + } + public Boolean getAllowUnicodeIdentifiers() { return allowUnicodeIdentifiers; } @@ -1423,6 +1440,9 @@ public class DefaultCodegen implements CodegenConfig { // option to change the order of form/body parameter cliOptions.add(CliOption.newBoolean(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS_DESC).defaultValue(Boolean.FALSE.toString())); + cliOptions.add(CliOption.newBoolean(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, + CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC).defaultValue(Boolean.TRUE.toString())); + // initialize special character mapping initalizeSpecialCharacterMapping(); @@ -2115,7 +2135,10 @@ public class DefaultCodegen implements CodegenConfig { } m.isAlias = (typeAliases.containsKey(name) || isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types - m.discriminator = createDiscriminator(name, schema); + m.discriminator = createDiscriminator(name, schema, this.openAPI); + if (!this.getLegacyDiscriminatorBehavior()) { + m.addDiscriminatorMappedModelsImports(); + } if (schema.getDeprecated() != null) { m.isDeprecated = schema.getDeprecated(); @@ -2161,7 +2184,10 @@ public class DefaultCodegen implements CodegenConfig { 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): {}", name); - m.discriminator = createDiscriminator(name, innerSchema); + m.discriminator = createDiscriminator(name, innerSchema, this.openAPI); + if (!this.getLegacyDiscriminatorBehavior()) { + m.addDiscriminatorMappedModelsImports(); + } modelDiscriminators++; } @@ -2285,6 +2311,7 @@ public class DefaultCodegen implements CodegenConfig { required.addAll(composed.getRequired()); allRequired.addAll(composed.getRequired()); } + addVars(m, unaliasPropertySchema(properties), required, unaliasPropertySchema(allProperties), allRequired); // end of code block for composed schema @@ -2353,6 +2380,22 @@ public class DefaultCodegen implements CodegenConfig { } } + // set isDiscriminator on the discriminator property + if (m.discriminator != null) { + String discPropName = m.discriminator.getPropertyBaseName(); + List> listOLists = new ArrayList>(); + listOLists.add(m.requiredVars); + listOLists.add(m.vars); + listOLists.add(m.allVars); + for (List theseVars: listOLists) { + for (CodegenProperty requiredVar: theseVars) { + if (discPropName.equals(requiredVar.baseName)) { + requiredVar.isDiscriminator = true; + } + } + } + } + if (sortModelPropertiesByRequiredFlag) { Comparator comparator = new Comparator() { @Override @@ -2369,36 +2412,316 @@ public class DefaultCodegen implements CodegenConfig { return m; } - protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema) { - if (schema.getDiscriminator() == null) { + /** + * 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) { + Schema discSchema = (Schema) refSchema.getProperties().get(discPropName); + CodegenProperty cp = new CodegenProperty(); + if (ModelUtils.isStringSchema(discSchema)) { + cp.isString = true; + } + cp.setRequired(false); + if (refSchema.getRequired() != null && refSchema.getRequired().contains(discPropName)) { + cp.setRequired(true); + } + return cp; + } + if (ModelUtils.isComposedSchema(refSchema)) { + ComposedSchema composedSchema = (ComposedSchema) refSchema; + if (composedSchema.getAllOf() != null) { + // If our discriminator is in one of the allOf schemas break when we find it + for (Schema allOf: composedSchema.getAllOf()) { + CodegenProperty cp = discriminatorFound(composedSchemaName, allOf, discPropName, openAPI); + if (cp != null) { + return cp; + } + } + } + if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { + // All oneOf definitions must contain the discriminator + CodegenProperty cp = new CodegenProperty(); + for (Schema oneOf: composedSchema.getOneOf()) { + String modelName = ModelUtils.getSimpleRef(oneOf.get$ref()); + CodegenProperty thisCp = discriminatorFound(composedSchemaName, oneOf, discPropName, openAPI); + if (thisCp == null) { + throw new RuntimeException("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced OneOf schema '" + modelName + "' is missing "+discPropName); + } + if (cp.dataType == null) { + cp = thisCp; + continue; + } + if (cp != thisCp) { + throw new RuntimeException("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the OneOf schema '" + modelName + "' has a different "+discPropName+" definition than the prior OneOf schema's. Make sure the "+discPropName+" type and required values are the same"); + } + } + return cp; + } + if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { + // All anyOf definitions must contain the discriminator because a min of one must be selected + CodegenProperty cp = new CodegenProperty(); + for (Schema anyOf: composedSchema.getAnyOf()) { + String modelName = ModelUtils.getSimpleRef(anyOf.get$ref()); + CodegenProperty thisCp = discriminatorFound(composedSchemaName, anyOf, discPropName, openAPI); + if (thisCp == null) { + throw new RuntimeException("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced AnyOf schema '" + modelName + "' is missing "+discPropName); + } + if (cp.dataType == null) { + cp = thisCp; + continue; + } + if (cp != thisCp) { + throw new RuntimeException("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the AnyOf schema '" + modelName + "' has a different "+discPropName+" definition than the prior AnyOf schema's. Make sure the "+discPropName+" type and required values are the same"); + } + } + return cp; + + } + } + return null; + } + + /** + * Recursively look in Schema sc for the discriminator and return it + * Schema sc location + * OpenAPI openAPI the spec where we are searching for the discriminator + * @param sc The Schema that may contain the discriminator + */ + private Discriminator recursiveGetDiscriminator(Schema sc, OpenAPI openAPI) { + Schema refSchema = ModelUtils.getReferencedSchema(openAPI, sc); + Discriminator foundDisc = refSchema.getDiscriminator(); + if (foundDisc != null) { + return foundDisc; + } + if (!!this.getLegacyDiscriminatorBehavior()) { + return null; + } + Discriminator disc = new Discriminator(); + if (ModelUtils.isComposedSchema(refSchema)) { + ComposedSchema composedSchema = (ComposedSchema) refSchema; + if (composedSchema.getAllOf() != null) { + // If our discriminator is in one of the allOf schemas break when we find it + for (Schema allOf: composedSchema.getAllOf()) { + foundDisc = recursiveGetDiscriminator(allOf, openAPI); + if (foundDisc != null) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + } + } + if (composedSchema.getOneOf() != null && composedSchema.getOneOf().size() != 0) { + // All oneOf definitions must contain the discriminator + Integer hasDiscriminatorCnt = 0; + Set discriminatorsPropNames = new HashSet<>(); + for (Schema oneOf: composedSchema.getOneOf()) { + foundDisc = recursiveGetDiscriminator(oneOf, openAPI); + if (foundDisc != null) { + discriminatorsPropNames.add(foundDisc.getPropertyName()); + hasDiscriminatorCnt++; + } + } + if (hasDiscriminatorCnt == composedSchema.getOneOf().size() && discriminatorsPropNames.size() == 1) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + } + if (composedSchema.getAnyOf() != null && composedSchema.getAnyOf().size() != 0) { + // All anyOf definitions must contain the discriminator because a min of one must be selected + Integer hasDiscriminatorCnt = 0; + Set discriminatorsPropNames = new HashSet<>(); + for (Schema anyOf: composedSchema.getAnyOf()) { + foundDisc = recursiveGetDiscriminator(anyOf, openAPI); + if (foundDisc != null) { + discriminatorsPropNames.add(foundDisc.getPropertyName()); + hasDiscriminatorCnt++; + } + } + if (hasDiscriminatorCnt == composedSchema.getAnyOf().size() && discriminatorsPropNames.size() == 1) { + disc.setPropertyName(foundDisc.getPropertyName()); + disc.setMapping(foundDisc.getMapping()); + return disc; + } + } + } + return null; + } + + /** + * This function is only used for composed schemas which have a discriminator + * Process oneOf and anyOf models in a composed schema and adds them into + * a list if the oneOf and anyOf models contain + * the required discriminator. If they don't contain the required + * discriminator or the discriminator is the wrong type then an error is + * thrown + * @param composedSchemaName The String model name of the composed schema where we are setting the discriminator map + * @param discPropName The String that is the discriminator propertyName in the schema + * @param c The ComposedSchema that contains the discriminator and oneOf/anyOf schemas + * @param openAPI The OpenAPI spec that we are using + * @return the list of oneOf and anyOf MappedModel that need to be added to the discriminator map + */ + protected List getOneOfAnyOfDescendants(String composedSchemaName, String discPropName, ComposedSchema c, OpenAPI openAPI) { + ArrayList> listOLists = new ArrayList>(); + listOLists.add(c.getOneOf()); + listOLists.add(c.getAnyOf()); + List descendentSchemas = new ArrayList(); + for (List schemaList: listOLists) { + if (schemaList == null) { + continue; + } + for (Schema sc: schemaList) { + String ref = sc.get$ref(); + if (ref == null) { + // for schemas with no ref, it is not possible to build the discriminator map + // because ref is how we get the model name + // we only hit this use case for a schema with inline composed schemas, and one of those + // schemas also has inline composed schemas + // Note: if it is only inline one level, then the inline model resolver will move it into its own + // schema and make it a $ref schema in the oneOf/anyOf location + throw new RuntimeException("Invalid inline schema defined in oneOf/anyOf in '" + composedSchemaName + "'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the oneOf/anyOf schemas must use $ref. Change this inline definition to a $ref definition"); + } + CodegenProperty df = discriminatorFound(composedSchemaName, sc, discPropName, openAPI); + String modelName = ModelUtils.getSimpleRef(ref); + if (df == null || !df.isString || df.required != true) { + String msgSuffix = ""; + if (df == null) { + msgSuffix += discPropName+" is missing from the schema, define it as required and type string"; + } else { + if (!df.isString) { + msgSuffix += "invalid type for "+discPropName+", set it to string"; + } + if (df.required != true) { + String spacer = ""; + if (msgSuffix.length() != 0) { + spacer = ". "; + } + msgSuffix += spacer+"invalid optional definition of "+discPropName+", include it in required"; + } + } + throw new RuntimeException("'" + composedSchemaName + "' defines discriminator '" + discPropName + "', but the referenced schema '" + modelName + "' is incorrect. "+msgSuffix); + } + MappedModel mm = new MappedModel(modelName, toModelName(modelName)); + descendentSchemas.add(mm); + Schema cs = ModelUtils.getSchema(openAPI, modelName); + Map vendorExtensions = cs.getExtensions(); + if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { + String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); + mm = new MappedModel(xDiscriminatorValue, toModelName(modelName)); + descendentSchemas.add(mm); + } + + } + } + return descendentSchemas; + } + + protected List getAllOfDescendants(String thisSchemaName, OpenAPI openAPI) { + ArrayList queue = new ArrayList();; + List descendentSchemas = new ArrayList(); + Map schemas = ModelUtils.getSchemas(openAPI); + String currentSchemaName = thisSchemaName; + while (true) { + for (String childName : schemas.keySet()) { + if (childName == thisSchemaName) { + continue; + } + Schema child = schemas.get(childName); + if (ModelUtils.isComposedSchema(child)) { + ComposedSchema composedChild = (ComposedSchema) child; + List parents = composedChild.getAllOf(); + if (parents != null) { + for (Schema parent: parents) { + String ref = parent.get$ref(); + if (ref == null) { + // for schemas with no ref, it is not possible to build the discriminator map + // because ref is how we get the model name + // we only hit this use case for a schema with inline composed schemas, and one of those + // schemas also has inline composed schemas + throw new RuntimeException("Invalid inline schema defined in allOf in '" + childName + "'. Per the OpenApi spec, for this case when a composed schema defines a discriminator, the allOf schemas must use $ref. Change this inline definition to a $ref definition"); + } + String parentName = ModelUtils.getSimpleRef(ref); + if (parentName.equals(currentSchemaName)) { + if (queue.contains(childName) || descendentSchemas.contains(childName)) { + throw new RuntimeException("Stack overflow hit when looking for "+thisSchemaName+" an infinite loop starting and ending at "+childName+" was seen"); + } + queue.add(childName); + break; + } + } + } + } + } + if (queue.size() == 0) { + break; + } + currentSchemaName = queue.remove(0); + MappedModel mm = new MappedModel(currentSchemaName, toModelName(currentSchemaName)); + descendentSchemas.add(mm); + Schema cs = schemas.get(currentSchemaName); + Map vendorExtensions = cs.getExtensions(); + if (vendorExtensions != null && !vendorExtensions.isEmpty() && vendorExtensions.containsKey("x-discriminator-value")) { + String xDiscriminatorValue = (String) vendorExtensions.get("x-discriminator-value"); + mm = new MappedModel(xDiscriminatorValue, toModelName(currentSchemaName)); + descendentSchemas.add(mm); + } + } + return descendentSchemas; + } + + protected CodegenDiscriminator createDiscriminator(String schemaName, Schema schema, OpenAPI openAPI) { + Discriminator sourceDiscriminator = recursiveGetDiscriminator(schema, openAPI); + if (sourceDiscriminator == null) { return null; } CodegenDiscriminator discriminator = new CodegenDiscriminator(); - discriminator.setPropertyName(toVarName(schema.getDiscriminator().getPropertyName())); - discriminator.setPropertyBaseName(schema.getDiscriminator().getPropertyName()); + String discPropName = sourceDiscriminator.getPropertyName(); + discriminator.setPropertyName(toVarName(discPropName)); + discriminator.setPropertyBaseName(sourceDiscriminator.getPropertyName()); discriminator.setPropertyGetter(toGetter(discriminator.getPropertyName())); // FIXME: for now, we assume that the discriminator property is String discriminator.setPropertyType(typeMapping.get("string")); - discriminator.setMapping(schema.getDiscriminator().getMapping()); - if (schema.getDiscriminator().getMapping() != null && !schema.getDiscriminator().getMapping().isEmpty()) { - for (Entry e : schema.getDiscriminator().getMapping().entrySet()) { + discriminator.setMapping(sourceDiscriminator.getMapping()); + List uniqueDescendants = new ArrayList(); + if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) { + for (Entry e : sourceDiscriminator.getMapping().entrySet()) { String nameOrRef = e.getValue(); String name = nameOrRef.indexOf('/') >= 0 ? ModelUtils.getSimpleRef(nameOrRef) : nameOrRef; String modelName = toModelName(name); - discriminator.getMappedModels().add(new MappedModel(e.getKey(), modelName)); + uniqueDescendants.add(new MappedModel(e.getKey(), modelName)); } - } else { - Map allDefinitions = ModelUtils.getSchemas(this.openAPI); - allDefinitions.forEach((childName, child) -> { - if (child instanceof ComposedSchema && ((ComposedSchema) child).getAllOf() != null) { - - final List parentSchemas = ModelUtils.getAllParentsName((ComposedSchema) child, allDefinitions, true); - if (parentSchemas.contains(schemaName)) { - discriminator.getMappedModels().add(new MappedModel(childName, toModelName(childName))); - } - } - }); } + + boolean legacyUseCase = (this.getLegacyDiscriminatorBehavior() && uniqueDescendants.isEmpty()); + if (!this.getLegacyDiscriminatorBehavior() || legacyUseCase) { + // for schemas that allOf inherit from this schema, add those descendants to this discriminator map + List otherDescendants = getAllOfDescendants(schemaName, openAPI); + for (MappedModel otherDescendant: otherDescendants) { + if (!uniqueDescendants.contains(otherDescendant)) { + uniqueDescendants.add(otherDescendant); + } + } + } + // if there are composed oneOf/anyOf schemas, add them to this discriminator + if (ModelUtils.isComposedSchema(schema) && !this.getLegacyDiscriminatorBehavior()) { + List otherDescendants = getOneOfAnyOfDescendants(schemaName, discPropName, (ComposedSchema) schema, openAPI); + for (MappedModel otherDescendant: otherDescendants) { + if (!uniqueDescendants.contains(otherDescendant)) { + uniqueDescendants.add(otherDescendant); + } + } + } + if (!this.getLegacyDiscriminatorBehavior()) { + Collections.sort(uniqueDescendants); + } + discriminator.getMappedModels().addAll(uniqueDescendants); return discriminator; } @@ -2428,11 +2751,15 @@ public class DefaultCodegen implements CodegenConfig { } if (composedSchema.getOneOf() != null) { - throw new RuntimeException("Please report the issue: Cannot process oneOf (Composed Scheme) in addProperties: " + schema); + for (Schema component : composedSchema.getOneOf()) { + addProperties(properties, required, component); + } } if (composedSchema.getAnyOf() != null) { - throw new RuntimeException("Please report the issue: Cannot process anyOf (Composed Schema) in addProperties: " + schema); + for (Schema component : composedSchema.getAnyOf()) { + addProperties(properties, required, component); + } } return; @@ -5830,15 +6157,19 @@ public class DefaultCodegen implements CodegenConfig { * * @param cs ComposedSchema object to create as interface model * @param type name to use for the generated interface model + * @param openAPI OpenAPI spec that we are using */ - public void addOneOfInterfaceModel(ComposedSchema cs, String type) { + public void addOneOfInterfaceModel(ComposedSchema cs, String type, OpenAPI openAPI) { if (cs.getOneOf() == null) { return; } + CodegenModel cm = new CodegenModel(); - cm.discriminator = createDiscriminator("", (Schema) cs); - + cm.discriminator = createDiscriminator("", (Schema) cs, openAPI); + if (!this.getLegacyDiscriminatorBehavior()) { + cm.addDiscriminatorMappedModelsImports(); + } for (Schema o : Optional.ofNullable(cs.getOneOf()).orElse(Collections.emptyList())) { if (o.get$ref() == null) { if (cm.discriminator != null && o.get$ref() == 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 e8dab26d05..1681434c44 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 @@ -156,7 +156,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { return defaultValue; } - private void configureGeneratorProperties() { + void configureGeneratorProperties() { // allows generating only models by specifying a CSV of models to generate, or empty for all // NOTE: Boolean.TRUE is required below rather than `true` because of JVM boxing constraints and type inference. generateApis = GlobalSettings.getProperty(CodegenConstants.APIS) != null ? Boolean.TRUE : getGeneratorPropertyDefaultSwitch(CodegenConstants.APIS, null); @@ -394,7 +394,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator { } @SuppressWarnings("unchecked") - private void generateModels(List files, List allModels, List unusedModels) { + void generateModels(List files, List allModels, List unusedModels) { if (!generateModels) { // TODO: Process these anyway and add to dryRun info LOGGER.info("Skipping generation of models."); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java index 56c63ec0c6..89e189c8c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientExperimentalCodegen.java @@ -77,6 +77,7 @@ public class GoClientExperimentalCodegen extends GoClientCodegen { @Override public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); super.processOpts(); supportingFiles.add(new SupportingFile("utils.mustache", "", "utils.go")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 8d2544c6af..6aa9c08250 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -111,6 +111,8 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { @Override public void processOpts() { + this.setLegacyDiscriminatorBehavior(false); + super.processOpts(); supportingFiles.remove(new SupportingFile("api_client.mustache", packagePath(), "api_client.py")); diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index c438cd43eb..653f44062d 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -69,7 +69,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}}; {{/isContainer}} {{^isContainer}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; + {{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vendorExtensions.x-is-jackson-optional-nullable}} 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 c69e7d5945..de25b7cf97 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -643,9 +643,12 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} @@ -659,7 +662,7 @@ class ApiClient(object): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/modules/openapi-generator/src/main/resources/python/model.mustache b/modules/openapi-generator/src/main/resources/python/model.mustache index 70f6e7489a..112246604d 100644 --- a/modules/openapi-generator/src/main/resources/python/model.mustache +++ b/modules/openapi-generator/src/main/resources/python/model.mustache @@ -52,8 +52,9 @@ class {{classname}}(object): {{#discriminator}} discriminator_value_class_map = { - {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}}, - {{/-last}}{{/children}} +{{#children}} + '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^-last}},{{/-last}} +{{/children}} } {{/discriminator}} diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache index 60fff484ef..8b49e58edb 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/model_templates/classvars.mustache @@ -115,15 +115,11 @@ @staticmethod def discriminator(): - return {{^discriminator}}None{{/discriminator}}{{#discriminator}}{ - '{{{discriminatorName}}}': { -{{#children}} - '{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': {{{classname}}}, -{{/children}} -{{^children}} + {{^discriminator}}return None{{/discriminator}}{{#discriminator}}val = { {{#mappedModels}} - '{{mappingName}}': {{{modelName}}}, + '{{mappingName}}': {{{modelName}}}, {{/mappedModels}} -{{/children}} - }, - }{{/discriminator}} \ No newline at end of file + } + if not val: + return None + return {'{{{discriminatorName}}}': val}{{/discriminator}} \ 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 28fff725bb..bebe90010f 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 @@ -33,6 +33,7 @@ import io.swagger.v3.oas.models.responses.ApiResponse; import io.swagger.v3.oas.models.responses.ApiResponses; import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapitools.codegen.languages.JavaClientCodegen; import org.openapitools.codegen.templating.mustache.CamelCaseLambda; import org.openapitools.codegen.templating.mustache.IndentedLambda; import org.openapitools.codegen.templating.mustache.LowercaseLambda; @@ -42,6 +43,7 @@ import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; +import java.io.File; import java.util.*; import java.util.stream.Collectors; @@ -569,6 +571,7 @@ public class DefaultCodegenTest { public void testDiscriminatorWithCustomMapping() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); codegen.setOpenAPI(openAPI); String path = "/person/display/{personId}"; @@ -643,6 +646,570 @@ public class DefaultCodegenTest { Assert.assertEquals(adultModel.allParents, Collections.singletonList("Person")); } + @Test + public void testComposedSchemaAllOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setOpenAPI(openAPI); + codegen.setLegacyDiscriminatorBehavior(false); + Schema sc; + String modelName; + + String propertyName = "petType"; + String propertyBaseName = propertyName; + CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(); + emptyMapDisc.setPropertyName(propertyName); + emptyMapDisc.setPropertyBaseName(propertyBaseName); + + // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps + List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); + for (String leafModelName: leafModelNames) { + Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); + CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); + Assert.assertEquals(leafCm.discriminator, emptyMapDisc); + } + + // the Pet discriminator map contains all animals + Reptile (children + grandchildren) + CodegenDiscriminator petDisc = new CodegenDiscriminator(); + petDisc.setPropertyName(propertyName); + petDisc.setPropertyBaseName(propertyBaseName); + java.util.LinkedHashSet hs = new LinkedHashSet<>(); + for (String leafModelName: leafModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName))); + } + hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile"))); + petDisc.setMappedModels(hs); + modelName = "Pet"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel pet = codegen.fromModel(modelName, sc); + Assert.assertEquals(pet.discriminator, petDisc); + + // the Reptile discriminator contains both reptiles + List reptileModelNames = Arrays.asList("Lizard", "Snake"); + CodegenDiscriminator reptileDisc = new CodegenDiscriminator(); + reptileDisc.setPropertyName(propertyName); + reptileDisc.setPropertyBaseName(propertyBaseName); + hs.clear(); + for (String reptileModelName: reptileModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName))); + } + reptileDisc.setMappedModels(hs); + modelName = "Reptile"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel reptile = codegen.fromModel(modelName, sc); + Assert.assertEquals(reptile.discriminator, reptileDisc); + + // the MyPets discriminator contains Cat and Lizard + List myPetNames = Arrays.asList("Cat", "Lizard"); + CodegenDiscriminator myPetDisc = new CodegenDiscriminator(); + myPetDisc.setPropertyName(propertyName); + myPetDisc.setPropertyBaseName(propertyBaseName); + hs.clear(); + for (String myPetName: myPetNames) { + hs.add(new CodegenDiscriminator.MappedModel(myPetName, codegen.toModelName(myPetName))); + } + myPetDisc.setMappedModels(hs); + modelName = "MyPets"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel myPets = codegen.fromModel(modelName, sc); + Assert.assertEquals(myPets.discriminator, myPetDisc); + + // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator + modelName = "MyPetsNoDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); + Assert.assertEquals(myPetsNoDisc.discriminator, myPetDisc); + + CodegenModel cm; + + // the mapping in b is in A + modelName = "A"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); + hs.add(new CodegenDiscriminator.MappedModel("B", codegen.toModelName("B"))); + hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // the mapping in b is in B + modelName = "B"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); + hs.add(new CodegenDiscriminator.MappedModel("C", codegen.toModelName("C"))); + + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // the mapping in b is in C + modelName = "C"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + } + + @Test + public void testComposedSchemaAllOfDiscriminatorMapLegacy() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + // codegen.discriminatorExplicitMappingVerbose remains false in the legacy use case + codegen.setOpenAPI(openAPI); + Schema sc; + String modelName; + + String propertyName = "petType"; + String propertyBaseName = propertyName; + CodegenDiscriminator emptyMapDisc = new CodegenDiscriminator(); + emptyMapDisc.setPropertyName(propertyName); + emptyMapDisc.setPropertyBaseName(propertyBaseName); + + // all leaf Schemas have discriminators with PropertyName/BaseName + empty discriminator maps + List leafModelNames = Arrays.asList("Cat", "Dog", "Lizard", "Snake"); + for (String leafModelName: leafModelNames) { + Schema leafSc = openAPI.getComponents().getSchemas().get(leafModelName); + CodegenModel leafCm = codegen.fromModel(leafModelName, leafSc); + Assert.assertEquals(leafCm.discriminator, null); + } + + // the Pet discriminator map contains all animals + Reptile (children + grandchildren) + CodegenDiscriminator petDisc = new CodegenDiscriminator(); + petDisc.setPropertyName(propertyName); + petDisc.setPropertyBaseName(propertyBaseName); + java.util.LinkedHashSet hs = new LinkedHashSet<>(); + for (String leafModelName: leafModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(leafModelName, codegen.toModelName(leafModelName))); + } + hs.add(new CodegenDiscriminator.MappedModel("Reptile", codegen.toModelName("Reptile"))); + petDisc.setMappedModels(hs); + modelName = "Pet"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel pet = codegen.fromModel(modelName, sc); + Assert.assertEquals(pet.discriminator, petDisc); + + // the Reptile discriminator contains both reptiles + List reptileModelNames = Arrays.asList("Lizard", "Snake"); + CodegenDiscriminator reptileDisc = new CodegenDiscriminator(); + reptileDisc.setPropertyName(propertyName); + reptileDisc.setPropertyBaseName(propertyBaseName); + hs.clear(); + for (String reptileModelName: reptileModelNames) { + hs.add(new CodegenDiscriminator.MappedModel(reptileModelName, codegen.toModelName(reptileModelName))); + } + reptileDisc.setMappedModels(hs); + modelName = "Reptile"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel reptile = codegen.fromModel(modelName, sc); + Assert.assertEquals(reptile.discriminator, null); + + // the MyPets discriminator contains Cat and Lizard + CodegenDiscriminator myPetDisc = new CodegenDiscriminator(); + myPetDisc.setPropertyName(propertyName); + myPetDisc.setPropertyBaseName(propertyBaseName); + hs.clear(); + modelName = "MyPets"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel myPets = codegen.fromModel(modelName, sc); + Assert.assertEquals(myPets.discriminator, myPetDisc); + + // the MyPetsNoDisc discriminator is created because all oneOf classes have the same discriminator + modelName = "MyPetsNoDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + CodegenModel myPetsNoDisc = codegen.fromModel(modelName, sc); + Assert.assertEquals(myPetsNoDisc.discriminator, null); + + CodegenModel cm; + + // the mapping in b is in A + modelName = "A"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs.clear(); + hs.add(new CodegenDiscriminator.MappedModel("b", codegen.toModelName("B"))); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // the mapping in b is in B + modelName = "B"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + Assert.assertEquals(cm.discriminator, null); + + // the mapping in b is in C + modelName = "C"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + Assert.assertEquals(cm.discriminator, null); + } + + @Test + public void testComposedSchemaOneOfDiscriminatorsInvalid() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + HashMap hm = new HashMap<>(); + hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + + for(Map.Entry entry : hm.entrySet()) { + String modelName = entry.getKey(); + String errorMessageExpected = entry.getValue(); + + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + + try { + codegen.fromModel(modelName, sc); + Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + } catch (RuntimeException re) { + Assert.assertEquals(re.getMessage(), errorMessageExpected); + } + } + } + + @Test + public void testComposedSchemaAnyOfDiscriminatorsInvalid() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + HashMap hm = new HashMap<>(); + hm.put("ComposedDiscMissingNoProperties", "'ComposedDiscMissingNoProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingNoProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscMissingFromProperties", "'ComposedDiscMissingFromProperties' defines discriminator 'fruitType', but the referenced schema 'DiscMissingFromProperties' is incorrect. fruitType is missing from the schema, define it as required and type string"); + hm.put("ComposedDiscOptionalTypeCorrect", "'ComposedDiscOptionalTypeCorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeIncorrect", "'ComposedDiscOptionalTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscOptionalTypeInconsistent", "'ComposedDiscOptionalTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeIncorrect' is incorrect. invalid type for fruitType, set it to string. invalid optional definition of fruitType, include it in required"); + hm.put("ComposedDiscTypeIncorrect", "'ComposedDiscTypeIncorrect' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscTypeInconsistent", "'ComposedDiscTypeInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscTypeIncorrect' is incorrect. invalid type for fruitType, set it to string"); + hm.put("ComposedDiscRequiredInconsistent", "'ComposedDiscRequiredInconsistent' defines discriminator 'fruitType', but the referenced schema 'DiscOptionalTypeCorrect' is incorrect. invalid optional definition of fruitType, include it in required"); + + for(Map.Entry entry : hm.entrySet()) { + String modelName = entry.getKey(); + String errorMessageExpected = entry.getValue(); + + Schema sc = openAPI.getComponents().getSchemas().get(modelName); + + try { + codegen.fromModel(modelName, sc); + Assert.assertTrue(false, "A RuntimeException should have been thrown when processing "+modelName+ " but it was not"); + } catch (RuntimeException re) { + Assert.assertEquals(re.getMessage(), errorMessageExpected); + } + } + } + + @Test + public void testComposedSchemaAnyOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/anyOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenModel cm; + java.util.LinkedHashSet hs; + String mn; + + // inline anyOf models work because the inline schemas are turned into $refs + modelName = "FruitInlineDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "FruitInlineDisc_anyOf"; + hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); + mn = "FruitInlineDisc_anyOf_1"; + hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // inline anyOf with inline anyOf model doesn't work because we have null $refs and we throw an exception + final String fmodelName = "FruitInlineInlineDisc"; + final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); + Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); + + // ref anyOf models with discriminator in properties in those models + modelName = "FruitReqDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in allOf in those models + modelName = "FruitAllOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in the grandparent schemas of those anyof models + modelName = "FruitGrandparentDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + } + + @Test + public void testComposedSchemaOneOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/oneOfDiscriminator.yaml"); + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + String modelName; + Schema sc; + CodegenModel cm; + java.util.LinkedHashSet hs; + String mn; + + // inline oneOf models work because the inline schemas are turned into $refs + modelName = "FruitInlineDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "FruitInlineDisc_oneOf"; + hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); + mn = "FruitInlineDisc_oneOf_1"; + hs.add(new CodegenDiscriminator.MappedModel(mn, codegen.toModelName(mn))); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // inline oneOf with inline oneOf model doesn't work because we have null $refs and we throw an exception + final String fmodelName = "FruitInlineInlineDisc"; + final Schema fsc = openAPI.getComponents().getSchemas().get(fmodelName); + Assert.assertThrows(() -> codegen.fromModel(fmodelName, fsc)); + + // ref oneOf models with discriminator in properties in those models + modelName = "FruitReqDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaReqDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in allOf in those models + modelName = "FruitAllOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAllOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in anyOf in those models + modelName = "FruitAnyOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaAnyOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in oneOf in those models + modelName = "FruitOneOfDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleOneOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaOneOfDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + + // ref oneOf models with discriminator in the grandparent schemas of those oneof models + modelName = "FruitGrandparentDisc"; + sc = openAPI.getComponents().getSchemas().get(modelName); + cm = codegen.fromModel(modelName, sc); + hs = new java.util.LinkedHashSet(); + mn = "AppleGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + mn = "BananaGrandparentDisc"; + hs.add(new CodegenDiscriminator.MappedModel(mn, mn)); + Assert.assertEquals(cm.discriminator.getMappedModels(), hs); + } + + @Test + public void testComposedSchemaMyPetsOneOfDiscriminatorMap() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + String path = "/mypets"; + + Operation operation = openAPI.getPaths().get(path).getGet(); + CodegenOperation codegenOperation = codegen.fromOperation(path, "GET", operation, null); + verifyMyPetsDiscriminator(codegenOperation.discriminator); + + Schema pet = openAPI.getComponents().getSchemas().get("MyPets"); + CodegenModel petModel = codegen.fromModel("MyPets", pet); + verifyMyPetsDiscriminator(petModel.discriminator); + } + + @Test + public void testComposedSchemaAllOfHierarchy(){ + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf_composition_discriminator.yaml"); + + DefaultCodegen codegen = new DefaultCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); + codegen.setOpenAPI(openAPI); + + Schema pet = openAPI.getComponents().getSchemas().get("Lizard"); + CodegenModel petModel = codegen.fromModel("Lizard", pet); + verifyLizardDiscriminator(petModel.discriminator); + + pet = openAPI.getComponents().getSchemas().get("Reptile"); + petModel = codegen.fromModel("Reptile", pet); + verifyReptileDiscriminator(petModel.discriminator); + } + + private void verifyLizardDiscriminator(CodegenDiscriminator discriminator) { + CodegenDiscriminator test = new CodegenDiscriminator(); + String prop = "petType"; + test.setPropertyName(prop); + test.setPropertyBaseName(prop); + test.setMapping(null); + test.setMappedModels(new HashSet<>()); + assertEquals(discriminator, test); + } + + private void verifyReptileDiscriminator(CodegenDiscriminator discriminator) { + CodegenDiscriminator test = new CodegenDiscriminator(); + String prop = "petType"; + test.setPropertyName(prop); + test.setPropertyBaseName(prop); + test.setMapping(null); + test.setMappedModels(new HashSet(){{ + add(new CodegenDiscriminator.MappedModel("Snake", "Snake")); + add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); + }}); + assertEquals(discriminator, test); + } + + private void verifyMyPetsDiscriminator(CodegenDiscriminator discriminator) { + CodegenDiscriminator test = new CodegenDiscriminator(); + String prop = "petType"; + test.setPropertyName(prop); + test.setPropertyBaseName(prop); + test.setMapping(null); + test.setMappedModels(new HashSet(){{ + add(new CodegenDiscriminator.MappedModel("Cat", "Cat")); + add(new CodegenDiscriminator.MappedModel("Lizard", "Lizard")); + }}); + assertEquals(discriminator, test); + } + + public CodegenModel getModel(List allModels, String modelName) { + for (Object obj: allModels) { + HashMap hm = (HashMap) obj; + CodegenModel cm = (CodegenModel) hm.get("model"); + if (modelName.equals(cm.name)) { + return cm; + } + } + return null; + } + + @Test + public void verifyXDiscriminatorValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/x-discriminator-value.yaml"); + final DefaultCodegen config = new DefaultCodegen(); + config.setOpenAPI(openAPI); + + String modelName; + CodegenDiscriminator discriminator; + Schema sc; + CodegenModel cm; + + Boolean dryRun = Boolean.TRUE; + final DefaultGenerator generator = new DefaultGenerator(dryRun); + generator.openAPI = openAPI; + generator.config = config; + generator.configureGeneratorProperties(); + + // for us to check a model's children we need to run generator.generateModels + // because children are assigned in config.updateAllModels which is invoked in generator.generateModels + List files = new ArrayList<>(); + List filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI); + List allModels = new ArrayList<>(); + generator.generateModels(files, allModels, filteredSchemas); + + // check that the model's children contain the x-discriminator-values + modelName = "BaseObj"; + cm = getModel(allModels, modelName); + List excpectedDiscriminatorValues = new ArrayList<>(Arrays.asList("daily", "sub-obj")); + ArrayList xDiscriminatorValues = new ArrayList<>(); + for (CodegenModel child: cm.children) { + xDiscriminatorValues.add((String) child.vendorExtensions.get("x-discriminator-value")); + } + assertEquals(xDiscriminatorValues, excpectedDiscriminatorValues); + + // check that the discriminator's MappedModels also contains the x-discriminator-values + discriminator = new CodegenDiscriminator(); + String prop = "object_type"; + discriminator.setPropertyName(config.toVarName(prop)); + discriminator.setPropertyBaseName(prop); + discriminator.setMapping(null); + discriminator.setMappedModels(new HashSet(){{ + add(new CodegenDiscriminator.MappedModel("DailySubObj", "DailySubObj")); + add(new CodegenDiscriminator.MappedModel("SubObj", "SubObj")); + add(new CodegenDiscriminator.MappedModel("daily", "DailySubObj")); + add(new CodegenDiscriminator.MappedModel("sub-obj", "SubObj")); + }}); + assertEquals(cm.discriminator, discriminator); + } + + @Test public void testAllOfSingleRefNoOwnProps() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/composed-allof.yaml"); @@ -1033,6 +1600,8 @@ public class DefaultCodegenTest { test.getMapping().put("c", "Child"); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("a", "Adult")); test.getMappedModels().add(new CodegenDiscriminator.MappedModel("c", "Child")); + test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); + test.getMappedModels().add(new CodegenDiscriminator.MappedModel("Child", "Child")); Assert.assertEquals(discriminator, test); } @@ -1139,8 +1708,7 @@ public class DefaultCodegenTest { DefaultCodegen codegen = new DefaultCodegen(); codegen.supportsInheritance = true; - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/generic.yaml", null, new ParseOptions()).getOpenAPI(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); codegen.setOpenAPI(openAPI); CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); @@ -1169,8 +1737,7 @@ public class DefaultCodegenTest { codegen.supportsInheritance = true; codegen.setModelNamePrefix("prefix"); - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/generic.yaml", null, new ParseOptions()).getOpenAPI(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); codegen.setOpenAPI(openAPI); CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); @@ -1184,8 +1751,7 @@ public class DefaultCodegenTest { codegen.supportsInheritance = true; codegen.setModelNameSuffix("suffix"); - OpenAPI openAPI = new OpenAPIParser() - .readLocation("src/test/resources/3_0/generic.yaml", null, new ParseOptions()).getOpenAPI(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/generic.yaml"); codegen.setOpenAPI(openAPI); CodegenModel codegenModel = codegen.fromModel("Dog", openAPI.getComponents().getSchemas().get("Dog")); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java index 17fddc4cfb..45b03efccc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java @@ -70,6 +70,7 @@ public class BashClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, "false") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java index 226389505b..79cf084234 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java @@ -62,6 +62,7 @@ public class DartClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(DartClientCodegen.SUPPORT_DART2, "false") + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index da24d2e195..9e54e028f7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -67,6 +67,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { .put(DartDioClientCodegen.SUPPORT_DART2, "false") .put(DartDioClientCodegen.DATE_LIBRARY, DATE_LIBRARY) .put(DartDioClientCodegen.NULLABLE_FIELDS, NULLABLE_FIELDS) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java index 0a0f86e4ee..f6efa94aa5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java @@ -43,6 +43,7 @@ public class ElixirClientOptionsProvider implements OptionsProvider { .put("licenseHeader", "# Copyright 2017 Me\n#\n# Licensed under the Apache License") .put(CodegenConstants.PACKAGE_NAME, "yay_pets") .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java index 15a4666509..f883ebbed1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java @@ -48,6 +48,7 @@ public class HaskellServantOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(HaskellServantCodegen.PROP_SERVE_STATIC, HaskellServantCodegen.PROP_SERVE_STATIC_DEFAULT.toString()) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java index b1aed3e446..245957be40 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java @@ -58,6 +58,7 @@ public class PhpClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java index 8f2c1d574f..97ad8132ce 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java @@ -57,6 +57,7 @@ public class PhpLumenServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.ARTIFACT_VERSION, ARTIFACT_VERSION_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java index faf3992c99..a3f32f9b4a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java @@ -42,6 +42,7 @@ public class PhpSilexServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java index 98c1ded49d..4bf91932a3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java @@ -60,6 +60,7 @@ public class PhpSlim4ServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(PhpSlim4ServerCodegen.PSR7_IMPLEMENTATION, PSR7_IMPLEMENTATION_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java index 70eed81c9e..537b7b10c6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java @@ -57,6 +57,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java index dce16e7245..09bd0dceab 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java @@ -66,6 +66,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LIBRARY, LIBRARY) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java index f9ac4d5ee3..4b982932b9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java @@ -55,6 +55,7 @@ public class ScalaAkkaClientOptionsProvider implements OptionsProvider { .put("mainPackage", MAIN_PACKAGE_VALUE) .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING) .put("dateLibrary", DATE_LIBRARY) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java index c128ea1bba..11825e2ec1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java @@ -52,6 +52,7 @@ public class ScalaHttpClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put("dateLibrary", DATE_LIBRARY) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java index 6e496e915a..d83863cd73 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift3OptionsProvider.java @@ -79,6 +79,7 @@ public class Swift3OptionsProvider implements OptionsProvider { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java index 87c2ecbebd..aa2d61f282 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java @@ -81,6 +81,7 @@ public class Swift4OptionsProvider implements OptionsProvider { .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index 3f85681caa..d5cd8cbe38 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -80,6 +80,7 @@ public class Swift5OptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.API_NAME_PREFIX, "") .put(CodegenConstants.LIBRARY, LIBRARY_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index 5635465a63..51b62748e3 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -81,6 +81,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(TypeScriptAngularClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java index 2ab399a12b..1e008de1ed 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java @@ -53,6 +53,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider .put(CodegenConstants.MODEL_PROPERTY_NAMING, MODEL_PROPERTY_NAMING_VALUE) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java index 9c72ca44ab..58b5aa6182 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -59,6 +59,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { .put(TypeScriptAureliaClientCodegen.SNAPSHOT, Boolean.FALSE.toString()) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index 196e220fb3..7bec81c9ae 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -66,6 +66,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { .put(TypeScriptFetchClientCodegen.TYPESCRIPT_THREE_PLUS, TYPESCRIPT_THREE_PLUS) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java index 23da17ea1c..a2dc76d63f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java @@ -63,6 +63,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { .put(TypeScriptAngularClientCodegen.NPM_REPOSITORY, NPM_REPOSITORY) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) + .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java index 7191f6e5ee..cdde6ddc8f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientCodegenTest.java @@ -363,6 +363,7 @@ public class RubyClientCodegenTest { public void allOfTest() { final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); final RubyClientCodegen codegen = new RubyClientCodegen(); + codegen.setLegacyDiscriminatorBehavior(false); codegen.setModuleName("OnlinePetstore"); final Schema schema = openAPI.getComponents().getSchemas().get("Person"); @@ -372,10 +373,29 @@ public class RubyClientCodegenTest { CodegenDiscriminator codegenDiscriminator = person.getDiscriminator(); Set mappedModels = new LinkedHashSet(); - CodegenDiscriminator.MappedModel adult = new CodegenDiscriminator.MappedModel("a", "Adult"); - mappedModels.add(adult); - CodegenDiscriminator.MappedModel child = new CodegenDiscriminator.MappedModel("c", "Child"); - mappedModels.add(child); + mappedModels.add(new CodegenDiscriminator.MappedModel("a", "Adult")); + mappedModels.add(new CodegenDiscriminator.MappedModel("c", "Child")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Adult", "Adult")); + mappedModels.add(new CodegenDiscriminator.MappedModel("Child", "Child")); + Assert.assertEquals(codegenDiscriminator.getMappedModels(), mappedModels); + } + + @Test(description = "test allOf (OAS3)") + public void allOfTestLegacy() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/allOf.yaml"); + final RubyClientCodegen codegen = new RubyClientCodegen(); + // codegen.discriminatorExplicitMappingVerbose == false by default + codegen.setModuleName("OnlinePetstore"); + + final Schema schema = openAPI.getComponents().getSchemas().get("Person"); + codegen.setOpenAPI(openAPI); + CodegenModel person = codegen.fromModel("Person", schema); + Assert.assertNotNull(person); + + CodegenDiscriminator codegenDiscriminator = person.getDiscriminator(); + Set mappedModels = new LinkedHashSet(); + mappedModels.add(new CodegenDiscriminator.MappedModel("a", "Adult")); + mappedModels.add(new CodegenDiscriminator.MappedModel("c", "Child")); Assert.assertEquals(codegenDiscriminator.getMappedModels(), mappedModels); } diff --git a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml index 7397e6c5d5..ba8906a1a2 100644 --- a/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml @@ -2077,12 +2077,11 @@ definitions: properties: pet_type: type: string + discriminator: pet_type ParentPet: type: object allOf: - $ref: '#/definitions/GrandparentAnimal' - - type: object - discriminator: pet_type ChildCat: allOf: - $ref: '#/definitions/ParentPet' diff --git a/modules/openapi-generator/src/test/resources/2_0/x-discriminator-value.yaml b/modules/openapi-generator/src/test/resources/2_0/x-discriminator-value.yaml new file mode 100644 index 0000000000..9dc4dea3e2 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/2_0/x-discriminator-value.yaml @@ -0,0 +1,66 @@ +swagger: '2.0' +info: + description: 'blah' + version: 1.0.0 + title: sample spec +host: fake.site.com +tags: [] +schemes: + - https +paths: + /numberdata: + post: + operationId: getNumberHolder + consumes: + - application/json + produces: + - application/json + parameters: [] + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/BaseObj' +securityDefinitions: {} +definitions: + BaseObj: + type: object + discriminator: object_type + required: + - id + - object_type + properties: + id: + type: integer + format: int64 + object_type: + type: string + SubObjType: + type: string + enum: + - daily + - monthly + - quarterly + - yearly + SubObj: + x-discriminator-value: sub-obj + allOf: + - $ref: '#/definitions/BaseObj' + - type: object + discriminator: sub_obj_type + required: + - sub_obj_type + properties: + sub_obj_type: + $ref: '#/definitions/SubObjType' + name: + type: string + DailySubObj: + x-discriminator-value: daily + allOf: + - $ref: '#/definitions/SubObj' + - type: object + properties: + day_of_month: + type: integer + format: int32 \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator.yaml new file mode 100644 index 0000000000..efeaa5fd02 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/allOf_composition_discriminator.yaml @@ -0,0 +1,103 @@ +openapi: 3.0.2 +info: + title: OAI Specification example for Polymorphism + version: 1.0.0 +paths: + /pet: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + /reptile: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/Reptile' + /mypets: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/MyPets' +components: + schemas: + Pet: + type: object + required: + - petType + properties: + petType: + type: string + discriminator: + propertyName: petType + Cat: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + name: + type: string + Reptile: + allOf: + - $ref: '#/components/schemas/Pet' + Dog: + allOf: + - $ref: '#/components/schemas/Pet' + - type: object + properties: + bark: + type: string + Lizard: + allOf: + - $ref: '#/components/schemas/Reptile' + - type: object + properties: + lovesRocks: + type: boolean + Snake: + allOf: + - $ref: '#/components/schemas/Reptile' + - type: object + properties: + hasLegs: + type: boolean + MyPets: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Lizard' + discriminator: + propertyName: petType + # per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminatorObject + # this discriminator must be included to use it as a hint to pick a schema + MyPetsNoDisc: + oneOf: + - $ref: '#/components/schemas/Cat' + - $ref: '#/components/schemas/Lizard' + A: + type: object + required: + - petType + properties: + petType: + type: string + discriminator: + propertyName: petType + mapping: + b: '#/components/schemas/B' + B: + allOf: + - $ref: '#/components/schemas/A' + C: + allOf: + - $ref: '#/components/schemas/B' diff --git a/modules/openapi-generator/src/test/resources/3_0/anyOfDiscriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/anyOfDiscriminator.yaml new file mode 100644 index 0000000000..72fa6abbb7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/anyOfDiscriminator.yaml @@ -0,0 +1,244 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +paths: + /: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/FruitAllOfDisc' +components: + schemas: + FruitType: + properties: + fruitType: + type: string + required: + - fruitType + FruitInlineDisc: + anyOf: + - type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + - type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + discriminator: + propertyName: fruitType + FruitInlineInlineDisc: + anyOf: + - type: object + required: + - seeds + properties: + seeds: + type: integer + anyOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + - type: object + required: + - length + properties: + length: + type: integer + anyOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + discriminator: + propertyName: fruitType + FruitReqDisc: + anyOf: + - $ref: '#/components/schemas/AppleReqDisc' + - $ref: '#/components/schemas/BananaReqDisc' + discriminator: + propertyName: fruitType + AppleReqDisc: + type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + BananaReqDisc: + type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + FruitAllOfDisc: + anyOf: + - $ref: '#/components/schemas/AppleAllOfDisc' + - $ref: '#/components/schemas/BananaAllOfDisc' + discriminator: + propertyName: fruitType + AppleAllOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: '#/components/schemas/FruitType' + BananaAllOfDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: '#/components/schemas/FruitType' + FruitAnyOfDisc: + anyOf: + - $ref: '#/components/schemas/AppleAnyOfDisc' + - $ref: '#/components/schemas/BananaAnyOfDisc' + discriminator: + propertyName: fruitType + AppleAnyOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + anyOf: + - $ref: '#/components/schemas/FruitType' + BananaAnyOfDisc: + type: object + required: + - length + properties: + length: + type: integer + anyOf: + - $ref: '#/components/schemas/FruitType' + FruitGrandparentDisc: + anyOf: + - $ref: '#/components/schemas/AppleGrandparentDisc' + - $ref: '#/components/schemas/BananaGrandparentDisc' + discriminator: + propertyName: fruitType + Parent: + type: object + allOf: + # the FruitType schema is a grandparent of AppleGrandparentDisc + BananaGrandparentDisc + - $ref: '#/components/schemas/FruitType' + AppleGrandparentDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: '#/components/schemas/Parent' + BananaGrandparentDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: '#/components/schemas/Parent' + ComposedDiscMissingNoProperties: + anyOf: + - $ref: '#/components/schemas/DiscMissingNoProperties' + discriminator: + propertyName: fruitType + DiscMissingNoProperties: + type: object + ComposedDiscMissingFromProperties: + anyOf: + - $ref: '#/components/schemas/DiscMissingFromProperties' + discriminator: + propertyName: fruitType + DiscMissingFromProperties: + type: object + properties: + length: + type: integer + ComposedDiscOptionalTypeCorrect: + anyOf: + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + discriminator: + propertyName: fruitType + DiscOptionalTypeCorrect: + type: object + properties: + fruitType: + type: string + ComposedDiscOptionalTypeIncorrect: + anyOf: + - $ref: '#/components/schemas/DiscOptionalTypeIncorrect' + discriminator: + propertyName: fruitType + DiscOptionalTypeIncorrect: + type: object + properties: + fruitType: + type: integer + ComposedDiscOptionalTypeInconsistent: + anyOf: + - $ref: '#/components/schemas/DiscOptionalTypeIncorrect' + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + discriminator: + propertyName: fruitType + ComposedDiscTypeIncorrect: + anyOf: + - $ref: '#/components/schemas/DiscTypeIncorrect' + discriminator: + propertyName: fruitType + DiscTypeIncorrect: + type: object + properties: + fruitType: + type: integer + required: + - fruitType + ComposedDiscTypeInconsistent: + anyOf: + - $ref: '#/components/schemas/DiscTypeIncorrect' + - $ref: '#/components/schemas/FruitType' + discriminator: + propertyName: fruitType + ComposedDiscRequiredInconsistent: + anyOf: + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + - $ref: '#/components/schemas/FruitType' + discriminator: + propertyName: fruitType \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/oneOfDiscriminator.yaml b/modules/openapi-generator/src/test/resources/3_0/oneOfDiscriminator.yaml new file mode 100644 index 0000000000..e9a3429807 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/oneOfDiscriminator.yaml @@ -0,0 +1,268 @@ +openapi: 3.0.1 +info: + title: fruity + version: 0.0.1 +paths: + /: + get: + responses: + '200': + description: desc + content: + application/json: + schema: + $ref: '#/components/schemas/FruitAllOfDisc' +components: + schemas: + FruitType: + properties: + fruitType: + type: string + required: + - fruitType + FruitInlineDisc: + oneOf: + - type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + - type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + discriminator: + propertyName: fruitType + FruitInlineInlineDisc: + oneOf: + - type: object + required: + - seeds + properties: + seeds: + type: integer + oneOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + - type: object + required: + - length + properties: + length: + type: integer + oneOf: + - type: object + properties: + fruitType: + type: string + required: + - fruitType + discriminator: + propertyName: fruitType + FruitReqDisc: + oneOf: + - $ref: '#/components/schemas/AppleReqDisc' + - $ref: '#/components/schemas/BananaReqDisc' + discriminator: + propertyName: fruitType + AppleReqDisc: + type: object + required: + - seeds + - fruitType + properties: + seeds: + type: integer + fruitType: + type: string + BananaReqDisc: + type: object + required: + - length + - fruitType + properties: + length: + type: integer + fruitType: + type: string + FruitAllOfDisc: + oneOf: + - $ref: '#/components/schemas/AppleAllOfDisc' + - $ref: '#/components/schemas/BananaAllOfDisc' + discriminator: + propertyName: fruitType + AppleAllOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: '#/components/schemas/FruitType' + BananaAllOfDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: '#/components/schemas/FruitType' + FruitAnyOfDisc: + oneOf: + - $ref: '#/components/schemas/AppleAnyOfDisc' + - $ref: '#/components/schemas/BananaAnyOfDisc' + discriminator: + propertyName: fruitType + AppleAnyOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + anyOf: + - $ref: '#/components/schemas/FruitType' + BananaAnyOfDisc: + type: object + required: + - length + properties: + length: + type: integer + anyOf: + - $ref: '#/components/schemas/FruitType' + FruitOneOfDisc: + oneOf: + - $ref: '#/components/schemas/AppleOneOfDisc' + - $ref: '#/components/schemas/BananaOneOfDisc' + discriminator: + propertyName: fruitType + AppleOneOfDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + oneOf: + - $ref: '#/components/schemas/FruitType' + BananaOneOfDisc: + type: object + required: + - length + properties: + length: + type: integer + oneOf: + - $ref: '#/components/schemas/FruitType' + FruitGrandparentDisc: + oneOf: + - $ref: '#/components/schemas/AppleGrandparentDisc' + - $ref: '#/components/schemas/BananaGrandparentDisc' + discriminator: + propertyName: fruitType + Parent: + type: object + allOf: + # the FruitType schema is a grandparent of AppleGrandparentDisc + BananaGrandparentDisc + - $ref: '#/components/schemas/FruitType' + AppleGrandparentDisc: + type: object + required: + - seeds + properties: + seeds: + type: integer + allOf: + - $ref: '#/components/schemas/Parent' + BananaGrandparentDisc: + type: object + required: + - length + properties: + length: + type: integer + allOf: + - $ref: '#/components/schemas/Parent' + ComposedDiscMissingNoProperties: + oneOf: + - $ref: '#/components/schemas/DiscMissingNoProperties' + discriminator: + propertyName: fruitType + DiscMissingNoProperties: + type: object + ComposedDiscMissingFromProperties: + oneOf: + - $ref: '#/components/schemas/DiscMissingFromProperties' + discriminator: + propertyName: fruitType + DiscMissingFromProperties: + type: object + properties: + length: + type: integer + ComposedDiscOptionalTypeCorrect: + oneOf: + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + discriminator: + propertyName: fruitType + DiscOptionalTypeCorrect: + type: object + properties: + fruitType: + type: string + ComposedDiscOptionalTypeIncorrect: + oneOf: + - $ref: '#/components/schemas/DiscOptionalTypeIncorrect' + discriminator: + propertyName: fruitType + DiscOptionalTypeIncorrect: + type: object + properties: + fruitType: + type: integer + ComposedDiscOptionalTypeInconsistent: + oneOf: + - $ref: '#/components/schemas/DiscOptionalTypeIncorrect' + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + discriminator: + propertyName: fruitType + ComposedDiscTypeIncorrect: + oneOf: + - $ref: '#/components/schemas/DiscTypeIncorrect' + discriminator: + propertyName: fruitType + DiscTypeIncorrect: + type: object + properties: + fruitType: + type: integer + required: + - fruitType + ComposedDiscTypeInconsistent: + oneOf: + - $ref: '#/components/schemas/DiscTypeIncorrect' + - $ref: '#/components/schemas/FruitType' + discriminator: + propertyName: fruitType + ComposedDiscRequiredInconsistent: + oneOf: + - $ref: '#/components/schemas/DiscOptionalTypeCorrect' + - $ref: '#/components/schemas/FruitType' + discriminator: + propertyName: fruitType diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java index 00db7a1b7b..ff1964caa4 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/Animal.java @@ -43,7 +43,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign10x/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java index b5b4f315c1..345d773463 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/org/openapitools/client/model/Animal.java @@ -41,7 +41,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java index 1367d6dd78..4b6c177d34 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/Animal.java @@ -34,7 +34,7 @@ import android.os.Parcel; public class Animal implements Parcelable { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java index af469dda3f..cea2ff5988 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import java.io.IOException; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java index 57dad620ef..0390cab3e8 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/Animal.java @@ -45,7 +45,7 @@ import org.hibernate.validator.constraints.*; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java index bb64354ab5..4cbc678b53 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/Animal.java @@ -35,7 +35,7 @@ import org.hibernate.validator.constraints.*; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java index af9c0df703..87a9c706f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/Animal.java @@ -48,7 +48,7 @@ import javax.xml.bind.annotation.*; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; @XmlElement(name = "className") - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; @XmlElement(name = "color") diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java index af469dda3f..cea2ff5988 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import java.io.IOException; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java index 38b0a1b2f1..e93cac2705 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/org/openapitools/client/model/Animal.java @@ -44,7 +44,7 @@ import javax.validation.Valid; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java index 38b0a1b2f1..e93cac2705 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/org/openapitools/client/model/Animal.java @@ -44,7 +44,7 @@ import javax.validation.Valid; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java index 38b0a1b2f1..e93cac2705 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/Animal.java @@ -44,7 +44,7 @@ import javax.validation.Valid; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java index af469dda3f..cea2ff5988 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import java.io.IOException; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java index af469dda3f..cea2ff5988 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import java.io.IOException; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java index af469dda3f..cea2ff5988 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/Animal.java @@ -32,7 +32,7 @@ import java.io.IOException; public class Animal { public static final String SERIALIZED_NAME_CLASS_NAME = "className"; @SerializedName(SERIALIZED_NAME_CLASS_NAME) - private String className; + protected String className; public static final String SERIALIZED_NAME_COLOR = "color"; @SerializedName(SERIALIZED_NAME_COLOR) diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..bbadf265ba 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/Animal.java @@ -42,7 +42,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + protected String className; public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index bed70584ef..8aae783bfc 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -625,9 +625,12 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} @@ -641,7 +644,7 @@ class ApiClient(object): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/client/petstore/python-experimental/petstore_api/models/animal.py index 45058ec761..39dd9789ff 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/animal.py @@ -90,12 +90,13 @@ class Animal(ModelNormal): @staticmethod def discriminator(): - return { - 'class_name': { - 'Cat': cat.Cat, - 'Dog': dog.Dog, - }, + val = { + 'Cat': cat.Cat, + 'Dog': dog.Dog, } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 diff --git a/samples/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/client/petstore/python-experimental/petstore_api/models/cat.py index d40464eaf0..3f3c2384ec 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/cat.py @@ -91,7 +91,11 @@ class Cat(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 @@ -194,3 +198,16 @@ class Cat(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py index b83986bd68..e7894c9c7a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_cat.py @@ -90,7 +90,11 @@ class ChildCat(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'pet_type': val} attribute_map = { 'pet_type': 'pet_type', # noqa: E501 @@ -191,3 +195,16 @@ class ChildCat(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py index da568bd7d2..8544773e88 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_dog.py @@ -90,7 +90,11 @@ class ChildDog(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'pet_type': val} attribute_map = { 'pet_type': 'pet_type', # noqa: E501 @@ -191,3 +195,16 @@ class ChildDog(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py index 62fa11f26e..681e99ae66 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/child_lizard.py @@ -90,7 +90,11 @@ class ChildLizard(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'pet_type': val} attribute_map = { 'pet_type': 'pet_type', # noqa: E501 @@ -191,3 +195,16 @@ class ChildLizard(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/client/petstore/python-experimental/petstore_api/models/dog.py index 69af821b27..5d5712d428 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/dog.py @@ -91,7 +91,11 @@ class Dog(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 @@ -194,3 +198,16 @@ class Dog(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py b/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py index af25951ed7..db7e6f3388 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py @@ -29,6 +29,26 @@ from petstore_api.model_utils import ( # noqa: F401 str, validate_get_composed_info, ) +try: + from petstore_api.models import child_cat +except ImportError: + child_cat = sys.modules[ + 'petstore_api.models.child_cat'] +try: + from petstore_api.models import child_dog +except ImportError: + child_dog = sys.modules[ + 'petstore_api.models.child_dog'] +try: + from petstore_api.models import child_lizard +except ImportError: + child_lizard = sys.modules[ + 'petstore_api.models.child_lizard'] +try: + from petstore_api.models import parent_pet +except ImportError: + parent_pet = sys.modules[ + 'petstore_api.models.parent_pet'] class GrandparentAnimal(ModelNormal): @@ -79,7 +99,15 @@ class GrandparentAnimal(ModelNormal): @staticmethod def discriminator(): - return None + val = { + 'ChildCat': child_cat.ChildCat, + 'ChildDog': child_dog.ChildDog, + 'ChildLizard': child_lizard.ChildLizard, + 'ParentPet': parent_pet.ParentPet, + } + if not val: + return None + return {'pet_type': val} attribute_map = { 'pet_type': 'pet_type', # noqa: E501 @@ -134,3 +162,16 @@ class GrandparentAnimal(ModelNormal): # discard variable. continue setattr(self, var_name, var_value) + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py index cdb96676c5..e7f2a6fb63 100644 --- a/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py +++ b/samples/client/petstore/python-experimental/petstore_api/models/parent_pet.py @@ -99,13 +99,14 @@ class ParentPet(ModelComposed): @staticmethod def discriminator(): - return { - 'pet_type': { - 'ChildCat': child_cat.ChildCat, - 'ChildDog': child_dog.ChildDog, - 'ChildLizard': child_lizard.ChildLizard, - }, + val = { + 'ChildCat': child_cat.ChildCat, + 'ChildDog': child_dog.ChildDog, + 'ChildLizard': child_lizard.ChildLizard, } + if not val: + return None + return {'pet_type': val} attribute_map = { 'pet_type': 'pet_type', # noqa: E501 diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 6b9c738128..328c1a70e1 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -626,9 +626,12 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} @@ -642,7 +645,7 @@ class ApiClient(object): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index c0564c598f..a80084e04b 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -624,9 +624,12 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} @@ -640,7 +643,7 @@ class ApiClient(object): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py index 45058ec761..39dd9789ff 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/animal.py @@ -90,12 +90,13 @@ class Animal(ModelNormal): @staticmethod def discriminator(): - return { - 'class_name': { - 'Cat': cat.Cat, - 'Dog': dog.Dog, - }, + val = { + 'Cat': cat.Cat, + 'Dog': dog.Dog, } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py index 92076d35c0..c3641a6862 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/cat.py @@ -96,7 +96,11 @@ class Cat(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 @@ -200,3 +204,16 @@ class Cat(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py index 69af821b27..5d5712d428 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/dog.py @@ -91,7 +91,11 @@ class Dog(ModelComposed): @staticmethod def discriminator(): - return None + val = { + } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 @@ -194,3 +198,16 @@ class Dog(ModelComposed): 'oneOf': [ ], } + + @classmethod + def get_discriminator_class(cls, from_server, data): + """Returns the child class specified by the discriminator""" + discriminator = cls.discriminator() + discr_propertyname_py = list(discriminator.keys())[0] + discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + if from_server: + class_name = data[discr_propertyname_js] + else: + class_name = data[discr_propertyname_py] + class_name_to_discr_class = discriminator[discr_propertyname_py] + return class_name_to_discr_class.get(class_name) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py index 303838fd7d..d5ee114fe2 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/models/mammal.py @@ -97,12 +97,13 @@ class Mammal(ModelComposed): @staticmethod def discriminator(): - return { - 'class_name': { - 'whale': whale.Whale, - 'zebra': zebra.Zebra, - }, + val = { + 'whale': whale.Whale, + 'zebra': zebra.Zebra, } + if not val: + return None + return {'class_name': val} attribute_map = { 'class_name': 'className', # noqa: E501 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 c0564c598f..a80084e04b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -624,9 +624,12 @@ class ApiClient(object): :param klass: class literal. :return: model object. """ + has_discriminator = False + if (hasattr(klass, 'get_real_child_model') + and klass.discriminator_value_class_map): + has_discriminator = True - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): + if not klass.openapi_types and has_discriminator is False: return data kwargs = {} @@ -640,7 +643,7 @@ class ApiClient(object): instance = klass(**kwargs) - if hasattr(instance, 'get_real_child_model'): + if has_discriminator: klass_name = instance.get_real_child_model(data) if klass_name: instance = self.__deserialize(data, klass_name) From 58908e6494f38b7928b6be51ff450dce40f115ad Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 24 Apr 2020 09:07:15 -0700 Subject: [PATCH 16/25] [codegen] change x-oneOf-name to x-one-of-name. Consistency with naming conventions and x-all-of-name (#5820) * change x-oneOf-name to x-one-of-name. * Add code comments * Add code comments --- .../java/org/openapitools/codegen/DefaultCodegen.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 91edad3cd5..82cebbf022 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 @@ -1857,7 +1857,13 @@ public class DefaultCodegen implements CodegenConfig { } /** - * Return the name of the oneOf schema + * Return the name of the oneOf schema. + * + * This name is used to set the value of CodegenProperty.openApiType. + * + * If the 'x-one-of-name' extension is specified in the OAS document, return that value. + * Otherwise, a name is constructed by creating a comma-separated list of all the names + * of the oneOf schemas. * * @param names List of names * @param composedSchema composed schema From e8f486ba7f22ad7478b6dd380d2adbbb3b82e102 Mon Sep 17 00:00:00 2001 From: Sebastien Rosset Date: Fri, 24 Apr 2020 09:10:32 -0700 Subject: [PATCH 17/25] [Python experimental] Readme improvements (#6031) * Python experimental readme improvements * Python experimental readme improvements * execute scripts in bin directory --- .../resources/python/common_README.mustache | 4 +- .../resources/python/configuration.mustache | 56 +- .../README_common.mustache | 4 +- .../python/python_doc_auth_partial.mustache | 116 +++- .../client/petstore/python-asyncio/README.md | 10 +- .../python-asyncio/docs/AnotherFakeApi.md | 6 + .../petstore/python-asyncio/docs/FakeApi.md | 99 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../petstore/python-asyncio/docs/PetApi.md | 182 +++++-- .../petstore/python-asyncio/docs/StoreApi.md | 40 +- .../petstore/python-asyncio/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- .../petstore/python-experimental/README.md | 10 +- .../docs/AnotherFakeApi.md | 6 + .../python-experimental/docs/FakeApi.md | 105 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../python-experimental/docs/PetApi.md | 182 +++++-- .../python-experimental/docs/StoreApi.md | 40 +- .../python-experimental/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- .../client/petstore/python-tornado/README.md | 10 +- .../python-tornado/docs/AnotherFakeApi.md | 6 + .../petstore/python-tornado/docs/FakeApi.md | 99 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../petstore/python-tornado/docs/PetApi.md | 182 +++++-- .../petstore/python-tornado/docs/StoreApi.md | 40 +- .../petstore/python-tornado/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 20 +- samples/client/petstore/python/README.md | 10 +- .../petstore/python/docs/AnotherFakeApi.md | 6 + .../client/petstore/python/docs/FakeApi.md | 99 +++- .../python/docs/FakeClassnameTags123Api.md | 22 +- samples/client/petstore/python/docs/PetApi.md | 182 +++++-- .../client/petstore/python/docs/StoreApi.md | 40 +- .../client/petstore/python/docs/UserApi.md | 48 ++ .../python/petstore_api/configuration.py | 20 +- .../petstore/python-experimental/README.md | 10 +- .../docs/AnotherFakeApi.md | 6 + .../python-experimental/docs/DefaultApi.md | 6 + .../python-experimental/docs/FakeApi.md | 112 +++- .../docs/FakeClassnameTags123Api.md | 22 +- .../python-experimental/docs/PetApi.md | 498 +++++++++++++----- .../python-experimental/docs/StoreApi.md | 40 +- .../python-experimental/docs/UserApi.md | 48 ++ .../petstore_api/configuration.py | 56 +- .../openapi3/client/petstore/python/README.md | 10 +- .../petstore/python/docs/AnotherFakeApi.md | 6 + .../client/petstore/python/docs/DefaultApi.md | 6 + .../client/petstore/python/docs/FakeApi.md | 112 +++- .../python/docs/FakeClassnameTags123Api.md | 22 +- .../client/petstore/python/docs/PetApi.md | 182 +++++-- .../client/petstore/python/docs/StoreApi.md | 40 +- .../client/petstore/python/docs/UserApi.md | 48 ++ .../python/petstore_api/configuration.py | 20 +- 54 files changed, 2547 insertions(+), 591 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/common_README.mustache b/modules/openapi-generator/src/main/resources/python/common_README.mustache index 991002aa17..37060d6d1f 100644 --- a/modules/openapi-generator/src/main/resources/python/common_README.mustache +++ b/modules/openapi-generator/src/main/resources/python/common_README.mustache @@ -1,13 +1,13 @@ ```python from __future__ import print_function +{{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} from {{{packageName}}}.rest import ApiException from pprint import pprint {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{> python_doc_auth_partial}} -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" + # Enter a context with an instance of the API client with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class diff --git a/modules/openapi-generator/src/main/resources/python/configuration.mustache b/modules/openapi-generator/src/main/resources/python/configuration.mustache index 7fdcd89427..dceab63e67 100644 --- a/modules/openapi-generator/src/main/resources/python/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/python/configuration.mustache @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = {{{packageName}}}.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 {{/hasApiKeyMethods}} @@ -80,10 +82,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = {{{packageName}}}.Configuration( - username='the-user', - password='the-password', - ) + +conf = {{{packageName}}}.Configuration( + username='the-user', + password='the-password', +) + {{/hasHttpBasicMethods}} {{#hasHttpSignatureMethods}} @@ -107,24 +111,24 @@ class Configuration(object): 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 = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) +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) + ) +) {{/hasHttpSignatureMethods}} {{/hasAuthMethods}} """ diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache index b474eb264a..7d9811fdfb 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/README_common.mustache @@ -1,12 +1,12 @@ ```python from __future__ import print_function +{{#apiInfo}}{{#apis}}{{^hasMore}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/hasMore}}{{/apis}}{{/apiInfo}} import time import {{{packageName}}} from pprint import pprint {{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} {{> python_doc_auth_partial}} -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" + # Enter a context with an instance of the API client with {{{packageName}}}.ApiClient(configuration) as api_client: # Create an instance of the API class diff --git a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache index d8cfc4ad11..3086d770b1 100644 --- a/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache +++ b/modules/openapi-generator/src/main/resources/python/python_doc_auth_partial.mustache @@ -1,51 +1,113 @@ +# 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}}}" +) + {{#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. {{#authMethods}} -configuration = {{{packageName}}}.Configuration() {{#isBasic}} {{#isBasicBasic}} + # Configure HTTP basic authorization: {{{name}}} -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +configuration = {{{packageName}}}.Configuration( + username = 'YOUR_USERNAME', + password = 'YOUR_PASSWORD' +) {{/isBasicBasic}} {{#isBasicBearer}} + # Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}} -configuration.access_token = 'YOUR_BEARER_TOKEN' +configuration = {{{packageName}}}.Configuration( + access_token = 'YOUR_BEARER_TOKEN' +) {{/isBasicBearer}} {{#isHttpSignature}} -# Configure HTTP signature authorization: {{{name}}} -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = {{{packageName}}}.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) + +# 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) + ) ) {{/isHttpSignature}} {{/isBasic}} {{#isApiKey}} + # Configure API key authorization: {{{name}}} -configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY' +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}", + api_key = { + '{{{keyParamName}}}': 'YOUR_API_KEY' + } +) # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed # configuration.api_key_prefix['{{{keyParamName}}}'] = 'Bearer' {{/isApiKey}} {{#isOAuth}} + # Configure OAuth2 access token for authorization: {{{name}}} +configuration = {{{packageName}}}.Configuration( + host = "{{{basePath}}}" +) configuration.access_token = 'YOUR_ACCESS_TOKEN' {{/isOAuth}} {{/authMethods}} - -# Defining host is optional and default to {{{basePath}}} -configuration.host = "{{{basePath}}}" {{/hasAuthMethods}} diff --git a/samples/client/petstore/python-asyncio/README.md b/samples/client/petstore/python-asyncio/README.md index 36c0a082f3..1cfb40e579 100644 --- a/samples/client/petstore/python-asyncio/README.md +++ b/samples/client/petstore/python-asyncio/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_api from petstore_api.rest import ApiException 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md index f777f0d43e..047c4ae644 100644 --- a/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index d1d84afd1c..68a36b5f75 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -35,6 +35,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -90,6 +96,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -145,6 +157,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -200,6 +218,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -255,6 +279,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -310,6 +340,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -362,6 +398,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -418,6 +460,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -564,6 +621,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -634,6 +697,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -697,6 +766,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -750,6 +825,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -807,6 +888,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md index 160851b5c3..5e1739a561 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-asyncio/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-asyncio/docs/PetApi.md b/samples/client/petstore/python-asyncio/docs/PetApi.md index 5e9f9804ee..a07c55e726 100644 --- a/samples/client/petstore/python-asyncio/docs/PetApi.md +++ b/samples/client/petstore/python-asyncio/docs/PetApi.md @@ -29,12 +29,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -90,12 +100,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -155,12 +175,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -219,12 +249,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -348,12 +400,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -411,12 +473,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -475,12 +547,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -540,12 +622,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/client/petstore/python-asyncio/docs/StoreApi.md b/samples/client/petstore/python-asyncio/docs/StoreApi.md index 360d7e0186..8d5e2178ea 100644 --- a/samples/client/petstore/python-asyncio/docs/StoreApi.md +++ b/samples/client/petstore/python-asyncio/docs/StoreApi.md @@ -25,6 +25,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -142,6 +160,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -198,6 +222,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-asyncio/docs/UserApi.md b/samples/client/petstore/python-asyncio/docs/UserApi.md index 1d69ee7aa6..6cb9d1ec38 100644 --- a/samples/client/petstore/python-asyncio/docs/UserApi.md +++ b/samples/client/petstore/python-asyncio/docs/UserApi.md @@ -29,6 +29,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,6 +88,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -135,6 +147,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -190,6 +208,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -244,6 +268,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -300,6 +330,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -357,6 +393,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -408,6 +450,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-asyncio/petstore_api/configuration.py b/samples/client/petstore/python-asyncio/petstore_api/configuration.py index ef96f1bc5c..a93073e814 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/configuration.py +++ b/samples/client/petstore/python-asyncio/petstore_api/configuration.py @@ -61,10 +61,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -77,10 +79,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python-experimental/README.md b/samples/client/petstore/python-experimental/README.md index f64e70f79d..81b680fa57 100644 --- a/samples/client/petstore/python-experimental/README.md +++ b/samples/client/petstore/python-experimental/README.md @@ -46,13 +46,19 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md index 493dd47a4c..83a89addfa 100644 --- a/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -21,6 +21,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/FakeApi.md b/samples/client/petstore/python-experimental/docs/FakeApi.md index 59b07dd05a..de9a3fd1a4 100644 --- a/samples/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/client/petstore/python-experimental/docs/FakeApi.md @@ -35,6 +35,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -90,6 +96,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -146,6 +158,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -202,6 +220,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -258,6 +282,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -314,6 +344,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -370,6 +406,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -422,6 +464,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -478,6 +526,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -534,6 +588,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -592,13 +652,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -689,6 +758,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -760,6 +835,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -831,6 +912,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -884,6 +971,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index 1b5308a819..c10f9f37e1 100644 --- a/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -22,15 +22,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-experimental/docs/PetApi.md b/samples/client/petstore/python-experimental/docs/PetApi.md index c7f69f794b..d7192a2dd5 100644 --- a/samples/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/client/petstore/python-experimental/docs/PetApi.md @@ -28,12 +28,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -89,12 +99,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -162,12 +182,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -226,12 +256,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -290,15 +330,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -355,12 +407,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -418,12 +480,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -490,12 +562,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -566,12 +648,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/client/petstore/python-experimental/docs/StoreApi.md b/samples/client/petstore/python-experimental/docs/StoreApi.md index efcc4a3ea2..b4492962d6 100644 --- a/samples/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/client/petstore/python-experimental/docs/StoreApi.md @@ -24,6 +24,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -81,15 +87,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -141,6 +159,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -197,6 +221,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/client/petstore/python-experimental/docs/UserApi.md b/samples/client/petstore/python-experimental/docs/UserApi.md index 4473840b5c..b02b92afbf 100644 --- a/samples/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/client/petstore/python-experimental/docs/UserApi.md @@ -28,6 +28,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -81,6 +87,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -134,6 +146,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -189,6 +207,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -243,6 +267,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -299,6 +329,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -356,6 +392,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -407,6 +449,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/client/petstore/python-experimental/petstore_api/configuration.py b/samples/client/petstore/python-experimental/petstore_api/configuration.py index 066665d16f..32406df02f 100644 --- a/samples/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/client/petstore/python-experimental/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python-tornado/README.md b/samples/client/petstore/python-tornado/README.md index 36c0a082f3..1cfb40e579 100644 --- a/samples/client/petstore/python-tornado/README.md +++ b/samples/client/petstore/python-tornado/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_api from petstore_api.rest import ApiException 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md index f777f0d43e..047c4ae644 100644 --- a/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python-tornado/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index d1d84afd1c..68a36b5f75 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -35,6 +35,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -90,6 +96,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -145,6 +157,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -200,6 +218,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -255,6 +279,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -310,6 +340,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -362,6 +398,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -418,6 +460,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -564,6 +621,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -634,6 +697,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -697,6 +766,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -750,6 +825,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -807,6 +888,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md index 160851b5c3..5e1739a561 100644 --- a/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python-tornado/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python-tornado/docs/PetApi.md b/samples/client/petstore/python-tornado/docs/PetApi.md index 5e9f9804ee..a07c55e726 100644 --- a/samples/client/petstore/python-tornado/docs/PetApi.md +++ b/samples/client/petstore/python-tornado/docs/PetApi.md @@ -29,12 +29,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -90,12 +100,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -155,12 +175,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -219,12 +249,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -348,12 +400,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -411,12 +473,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -475,12 +547,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -540,12 +622,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/client/petstore/python-tornado/docs/StoreApi.md b/samples/client/petstore/python-tornado/docs/StoreApi.md index 360d7e0186..8d5e2178ea 100644 --- a/samples/client/petstore/python-tornado/docs/StoreApi.md +++ b/samples/client/petstore/python-tornado/docs/StoreApi.md @@ -25,6 +25,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -142,6 +160,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -198,6 +222,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-tornado/docs/UserApi.md b/samples/client/petstore/python-tornado/docs/UserApi.md index 1d69ee7aa6..6cb9d1ec38 100644 --- a/samples/client/petstore/python-tornado/docs/UserApi.md +++ b/samples/client/petstore/python-tornado/docs/UserApi.md @@ -29,6 +29,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,6 +88,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -135,6 +147,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -190,6 +208,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -244,6 +268,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -300,6 +330,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -357,6 +393,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -408,6 +450,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python-tornado/petstore_api/configuration.py b/samples/client/petstore/python-tornado/petstore_api/configuration.py index 066665d16f..32406df02f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/configuration.py +++ b/samples/client/petstore/python-tornado/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index 36c0a082f3..1cfb40e579 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_api from petstore_api.rest import ApiException 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python/docs/AnotherFakeApi.md b/samples/client/petstore/python/docs/AnotherFakeApi.md index f777f0d43e..047c4ae644 100644 --- a/samples/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/client/petstore/python/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index d1d84afd1c..68a36b5f75 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -35,6 +35,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -90,6 +96,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -145,6 +157,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -200,6 +218,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -255,6 +279,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -310,6 +340,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -362,6 +398,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -418,6 +460,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -475,13 +523,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -564,6 +621,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -634,6 +697,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -697,6 +766,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -750,6 +825,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -807,6 +888,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md index 160851b5c3..5e1739a561 100644 --- a/samples/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/client/petstore/python/docs/PetApi.md b/samples/client/petstore/python/docs/PetApi.md index 5e9f9804ee..a07c55e726 100644 --- a/samples/client/petstore/python/docs/PetApi.md +++ b/samples/client/petstore/python/docs/PetApi.md @@ -29,12 +29,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -90,12 +100,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -155,12 +175,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -219,12 +249,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -283,15 +323,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -348,12 +400,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -411,12 +473,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -475,12 +547,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -540,12 +622,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/client/petstore/python/docs/StoreApi.md b/samples/client/petstore/python/docs/StoreApi.md index 360d7e0186..8d5e2178ea 100644 --- a/samples/client/petstore/python/docs/StoreApi.md +++ b/samples/client/petstore/python/docs/StoreApi.md @@ -25,6 +25,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -142,6 +160,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -198,6 +222,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python/docs/UserApi.md b/samples/client/petstore/python/docs/UserApi.md index 1d69ee7aa6..6cb9d1ec38 100644 --- a/samples/client/petstore/python/docs/UserApi.md +++ b/samples/client/petstore/python/docs/UserApi.md @@ -29,6 +29,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,6 +88,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -135,6 +147,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -190,6 +208,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -244,6 +268,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -300,6 +330,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -357,6 +393,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -408,6 +450,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 066665d16f..32406df02f 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None diff --git a/samples/openapi3/client/petstore/python-experimental/README.md b/samples/openapi3/client/petstore/python-experimental/README.md index a0988878b9..b2158bd965 100644 --- a/samples/openapi3/client/petstore/python-experimental/README.md +++ b/samples/openapi3/client/petstore/python-experimental/README.md @@ -46,13 +46,19 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function +import datetime import time import petstore_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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md index 831230e18c..7b8b3d6796 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/AnotherFakeApi.md @@ -21,6 +21,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md index 080fe8bd98..91623f7a45 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/DefaultApi.md @@ -19,6 +19,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md index c1146038a2..a31649db9a 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeApi.md @@ -32,6 +32,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -84,6 +90,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -140,6 +152,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -196,6 +214,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -252,6 +276,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -308,6 +338,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -360,6 +396,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -416,6 +458,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -473,13 +521,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -570,6 +627,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -642,12 +705,21 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure Bearer authorization (JWT): bearer_test -configuration.access_token = 'YOUR_BEARER_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -719,6 +791,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -772,6 +850,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -829,6 +913,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md index a93336558a..ab1eb4d62c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/FakeClassnameTags123Api.md @@ -22,15 +22,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md index 72f7fb27fc..62bcfdd1bd 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/PetApi.md @@ -28,33 +28,82 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -109,12 +158,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -181,33 +240,82 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -266,33 +374,82 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -351,15 +508,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -416,33 +585,82 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP signature authorization: http_signature_test -# You can specify the signing key-id, private key path, signing scheme, signing algorithm, -# list of signed headers and signature max validity. -configuration.signing_info = petstore_api.signing.HttpSigningConfiguration( - key_id = 'my-key-id', - private_key_path = 'rsa.pem', - signing_scheme = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'Content-Length', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) +# 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" ) -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -499,12 +717,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -571,12 +799,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -645,12 +883,22 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md index 4372edd565..4a7b890a1c 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/StoreApi.md @@ -24,6 +24,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -81,15 +87,27 @@ from __future__ import print_function import time import petstore_api from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -141,6 +159,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -197,6 +221,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md index 70c5e1232a..4aa31e100b 100644 --- a/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python-experimental/docs/UserApi.md @@ -28,6 +28,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -81,6 +87,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -134,6 +146,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -189,6 +207,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -243,6 +267,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -299,6 +329,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -356,6 +392,12 @@ from __future__ import print_function import time import petstore_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() as api_client: @@ -407,6 +449,12 @@ from __future__ import print_function import time import petstore_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() as api_client: diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py index d885572339..92c53fb54e 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/configuration.py @@ -64,10 +64,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -80,10 +82,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + HTTP Signature Authentication Example. Given the following security scheme in the OpenAPI specification: @@ -105,24 +109,24 @@ class Configuration(object): 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 = signing.SCHEME_HS2019, - signing_algorithm = signing.ALGORITHM_RSASSA_PSS, - signed_headers = [signing.HEADER_REQUEST_TARGET, - signing.HEADER_CREATED, - signing.HEADER_EXPIRES, - signing.HEADER_HOST, - signing.HEADER_DATE, - signing.HEADER_DIGEST, - 'Content-Type', - 'User-Agent' - ], - signature_max_validity = datetime.timedelta(minutes=5) - ) - ) +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 diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 39d427e7cc..2c3dd373c6 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -46,14 +46,20 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function + import time import petstore_api from petstore_api.rest import ApiException 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" +) + + -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md index d93ffd79f1..ecd52ad770 100644 --- a/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/AnotherFakeApi.md @@ -22,6 +22,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/DefaultApi.md b/samples/openapi3/client/petstore/python/docs/DefaultApi.md index dbb994da49..7f022fd7d3 100644 --- a/samples/openapi3/client/petstore/python/docs/DefaultApi.md +++ b/samples/openapi3/client/petstore/python/docs/DefaultApi.md @@ -20,6 +20,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index e1b0e67d42..2ae2daf4bb 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -33,6 +33,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -85,6 +91,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -140,6 +152,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -195,6 +213,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -250,6 +274,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -305,6 +335,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -357,6 +393,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -413,6 +455,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -470,13 +518,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure HTTP basic authorization: http_basic_test -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -559,6 +616,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -630,12 +693,21 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure Bearer authorization (JWT): bearer_test -configuration.access_token = 'YOUR_BEARER_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -699,6 +771,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -752,6 +830,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -809,6 +893,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md index bf60f00c6a..822fd39ace 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md +++ b/samples/openapi3/client/petstore/python/docs/FakeClassnameTags123Api.md @@ -23,15 +23,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 diff --git a/samples/openapi3/client/petstore/python/docs/PetApi.md b/samples/openapi3/client/petstore/python/docs/PetApi.md index eafac6a400..d64a86236a 100644 --- a/samples/openapi3/client/petstore/python/docs/PetApi.md +++ b/samples/openapi3/client/petstore/python/docs/PetApi.md @@ -29,12 +29,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -89,12 +99,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -153,12 +173,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -217,12 +247,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -281,15 +321,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -346,12 +398,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -408,12 +470,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -472,12 +544,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: @@ -537,12 +619,22 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() -# Configure OAuth2 access token for authorization: petstore_auth -configuration.access_token = 'YOUR_ACCESS_TOKEN' +# 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" +) -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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: diff --git a/samples/openapi3/client/petstore/python/docs/StoreApi.md b/samples/openapi3/client/petstore/python/docs/StoreApi.md index 9bfe9d95bf..3e6cc02faa 100644 --- a/samples/openapi3/client/petstore/python/docs/StoreApi.md +++ b/samples/openapi3/client/petstore/python/docs/StoreApi.md @@ -25,6 +25,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,15 +88,27 @@ import time import petstore_api from petstore_api.rest import ApiException from pprint import pprint -configuration = petstore_api.Configuration() +# 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' +configuration = petstore_api.Configuration( + host = "http://petstore.swagger.io:80/v2", + 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' -# Defining host is optional and default to http://petstore.swagger.io:80/v2 -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 @@ -142,6 +160,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -198,6 +222,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/openapi3/client/petstore/python/docs/UserApi.md b/samples/openapi3/client/petstore/python/docs/UserApi.md index 6de550edd9..32a62c8add 100644 --- a/samples/openapi3/client/petstore/python/docs/UserApi.md +++ b/samples/openapi3/client/petstore/python/docs/UserApi.md @@ -29,6 +29,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -82,6 +88,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -135,6 +147,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -190,6 +208,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -244,6 +268,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -300,6 +330,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -357,6 +393,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: @@ -408,6 +450,12 @@ import time import petstore_api from petstore_api.rest import ApiException 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() as api_client: diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index d0d05b1138..915a079502 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -62,10 +62,12 @@ class Configuration(object): name: JSESSIONID # cookie name You can programmatically set the cookie: - conf = petstore_api.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} - ) + +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 @@ -78,10 +80,12 @@ class Configuration(object): scheme: basic Configure API client with HTTP basic authentication: - conf = petstore_api.Configuration( - username='the-user', - password='the-password', - ) + +conf = petstore_api.Configuration( + username='the-user', + password='the-password', +) + """ _default = None From 0e276bef1932c7cb8ae0e519844679d496f5ec6a Mon Sep 17 00:00:00 2001 From: Kieran Simpson Date: Sat, 25 Apr 2020 12:20:40 +1000 Subject: [PATCH 18/25] Add input flag for Gradle openApiGenerate task (#5966) --- .../generator/gradle/plugin/tasks/GenerateTask.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt index f273d12427..d0c207711a 100644 --- a/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt +++ b/modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt @@ -21,6 +21,7 @@ import org.gradle.api.GradleException import org.gradle.api.provider.Property import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.options.Option import org.gradle.internal.logging.text.StyledTextOutput import org.gradle.internal.logging.text.StyledTextOutputFactory import org.gradle.kotlin.dsl.listProperty @@ -37,7 +38,7 @@ import org.openapitools.codegen.config.GlobalSettings * * Example (CLI): * - * ./gradlew -q openApiGenerate + * ./gradlew -q openApiGenerate --input=/path/to/file * * @author Jim Schubert */ @@ -68,6 +69,14 @@ open class GenerateTask : DefaultTask() { @get:Internal val outputDir = project.objects.property() + @Suppress("unused") + @get:Internal + @set:Option(option = "input", description = "The input specification.") + var input: String? = null + set(value) { + inputSpec.set(value) + } + /** * The Open API 2.0/3.x specification location. */ From cef5470ea84338fa7e7177628ad2f435cf6478c5 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 25 Apr 2020 23:39:41 +0800 Subject: [PATCH 19/25] Add Http signature authentication test to fake petstore spec (#6054) * add endpoint to test http signature * update plugin version --- .../examples/spring.xml | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 29 +++ .../client/petstore/go/go-petstore/README.md | 16 ++ .../petstore/go/go-petstore/api/openapi.yaml | 32 +++ .../petstore/go/go-petstore/api_fake.go | 81 ++++++ .../petstore/go/go-petstore/docs/FakeApi.md | 45 ++++ .../petstore/php/OpenAPIClient-php/README.md | 6 + .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 58 +++++ .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 245 ++++++++++++++++++ .../test/Api/FakeApiTest.php | 10 + .../openapi3/client/petstore/python/README.md | 7 +- .../client/petstore/python/docs/FakeApi.md | 64 +++++ .../python/petstore_api/api/fake_api.py | 122 +++++++++ .../python/petstore_api/configuration.py | 58 +++++ .../client/petstore/ruby-faraday/README.md | 4 + .../petstore/ruby-faraday/docs/FakeApi.md | 51 ++++ .../ruby-faraday/lib/petstore/api/fake_api.rb | 66 +++++ .../ruby-faraday/spec/api/fake_api_spec.rb | 13 + .../openapi3/client/petstore/ruby/README.md | 4 + .../client/petstore/ruby/docs/FakeApi.md | 51 ++++ .../ruby/lib/petstore/api/fake_api.rb | 66 +++++ .../petstore/ruby/spec/api/fake_api_spec.rb | 13 + .../java/org/openapitools/api/FakeApi.java | 15 ++ .../org/openapitools/api/FakeApiService.java | 2 + .../api/impl/FakeApiServiceImpl.java | 6 + 25 files changed, 1064 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index dda872981b..a0654ffe26 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 4.2.2-SNAPSHOT + 4.3.1-SNAPSHOT diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index eb023ac0b6..87f547a24b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1093,6 +1093,32 @@ paths: application/json: schema: $ref: '#/components/schemas/HealthCheckResult' + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - http_signature_test + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully servers: - url: 'http://{server}.swagger.io:{port}/v2' description: petstore server @@ -1168,6 +1194,9 @@ components: type: http scheme: bearer bearerFormat: JWT + http_signature_test: + type: http + scheme: signature schemas: Foo: type: object diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index c0f191d001..a08d441868 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -35,6 +35,7 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags *DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **Get** /foo | *FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **Get** /fake/health | Health check endpoint +*FakeApi* | [**FakeHttpSignatureTest**](docs/FakeApi.md#fakehttpsignaturetest) | **Get** /fake/http-signature-test | test http signature authentication *FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | *FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | *FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | @@ -189,6 +190,21 @@ r, err := client.Service.Operation(auth, args) ``` +## http_signature_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + ## petstore_auth diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 71d688ccea..8ac184e2ef 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1169,6 +1169,35 @@ paths: summary: Health check endpoint tags: - fake + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: [] + summary: test http signature authentication + tags: + - fake components: requestBodies: UserArray: @@ -2057,3 +2086,6 @@ components: bearerFormat: JWT scheme: bearer type: http + http_signature_test: + scheme: signature + type: http 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 c47eeaebb1..8c5521b643 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api_fake.go +++ b/samples/openapi3/client/petstore/go/go-petstore/api_fake.go @@ -101,6 +101,87 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, return localVarReturnValue, localVarHTTPResponse, nil } +// FakeHttpSignatureTestOpts Optional parameters for the method 'FakeHttpSignatureTest' +type FakeHttpSignatureTestOpts struct { + Query1 optional.String + Header1 optional.String +} + +/* +FakeHttpSignatureTest test http signature authentication + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pet Pet object that needs to be added to the store + * @param optional nil or *FakeHttpSignatureTestOpts - Optional Parameters: + * @param "Query1" (optional.String) - query parameter + * @param "Header1" (optional.String) - header parameter +*/ +func (a *FakeApiService) FakeHttpSignatureTest(ctx _context.Context, pet Pet, localVarOptionals *FakeHttpSignatureTestOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/http-signature-test" + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.Query1.IsSet() { + localVarQueryParams.Add("query_1", parameterToString(localVarOptionals.Query1.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Header1.IsSet() { + localVarHeaderParams["header_1"] = parameterToString(localVarOptionals.Header1.Value(), "") + } + // body params + localVarPostBody = &pet + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' type FakeOuterBooleanSerializeOpts struct { Body optional.Bool 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 3634a8771e..eab45b0e2c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**FakeHealthGet**](FakeApi.md#FakeHealthGet) | **Get** /fake/health | Health check endpoint +[**FakeHttpSignatureTest**](FakeApi.md#FakeHttpSignatureTest) | **Get** /fake/http-signature-test | test http signature authentication [**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | [**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | [**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | @@ -49,6 +50,50 @@ No authorization required [[Back to README]](../README.md) +## FakeHttpSignatureTest + +> FakeHttpSignatureTest(ctx, pet, optional) + +test http signature authentication + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **optional** | ***FakeHttpSignatureTestOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeHttpSignatureTestOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **query1** | **optional.String**| query parameter | + **header1** | **optional.String**| header parameter | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +[[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) + + ## FakeOuterBooleanSerialize > bool FakeOuterBooleanSerialize(ctx, optional) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md index 2f2c6d2e0a..ea2f41c1b1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/README.md @@ -86,6 +86,7 @@ Class | Method | HTTP request | Description *AnotherFakeApi* | [**call123TestSpecialTags**](docs/Api/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *DefaultApi* | [**fooGet**](docs/Api/DefaultApi.md#fooget) | **GET** /foo | *FakeApi* | [**fakeHealthGet**](docs/Api/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fakeHttpSignatureTest**](docs/Api/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -214,6 +215,11 @@ Class | Method | HTTP request | Description +## http_signature_test + + + + ## petstore_auth diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index c3b5b2f1e2..20d18e8499 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -71,6 +72,63 @@ No authorization required [[Back to README]](../../README.md) +## fakeHttpSignatureTest + +> fakeHttpSignatureTest($pet, $query_1, $header_1) + +test http signature authentication + +### Example + +```php +fakeHttpSignatureTest($pet, $query_1, $header_1); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->fakeHttpSignatureTest: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**\OpenAPI\Client\Model\Pet**](../Model/Pet.md)| Pet object that needs to be added to the store | + **query_1** | **string**| query parameter | [optional] + **header_1** | **string**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + +[[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) + + ## fakeOuterBooleanSerialize > bool fakeOuterBooleanSerialize($body) diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 76ffdb3cdb..1dff569945 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -369,6 +369,251 @@ class FakeApi ); } + /** + * Operation fakeHttpSignatureTest + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function fakeHttpSignatureTest($pet, $query_1 = null, $header_1 = null) + { + $this->fakeHttpSignatureTestWithHttpInfo($pet, $query_1, $header_1); + } + + /** + * Operation fakeHttpSignatureTestWithHttpInfo + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \OpenAPI\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function fakeHttpSignatureTestWithHttpInfo($pet, $query_1 = null, $header_1 = null) + { + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation fakeHttpSignatureTestAsync + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeHttpSignatureTestAsync($pet, $query_1 = null, $header_1 = null) + { + return $this->fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1, $header_1) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation fakeHttpSignatureTestAsyncWithHttpInfo + * + * test http signature authentication + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function fakeHttpSignatureTestAsyncWithHttpInfo($pet, $query_1 = null, $header_1 = null) + { + $returnType = ''; + $request = $this->fakeHttpSignatureTestRequest($pet, $query_1, $header_1); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'fakeHttpSignatureTest' + * + * @param \OpenAPI\Client\Model\Pet $pet Pet object that needs to be added to the store (required) + * @param string $query_1 query parameter (optional) + * @param string $header_1 header parameter (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function fakeHttpSignatureTestRequest($pet, $query_1 = null, $header_1 = null) + { + // verify the required parameter 'pet' is set + if ($pet === null || (is_array($pet) && count($pet) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $pet when calling fakeHttpSignatureTest' + ); + } + + $resourcePath = '/fake/http-signature-test'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($query_1 !== null) { + if('form' === 'form' && is_array($query_1)) { + foreach($query_1 as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['query_1'] = $query_1; + } + } + + // header params + if ($header_1 !== null) { + $headerParams['header_1'] = ObjectSerializer::toHeaderValue($header_1); + } + + + // body params + $_tempBody = null; + if (isset($pet)) { + $_tempBody = $pet; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + ['application/json', 'application/xml'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + } else { + $httpBody = $_tempBody; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation fakeOuterBooleanSerialize * diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index ca90b2a5e5..02c31a93c3 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -82,6 +82,16 @@ class FakeApiTest extends TestCase { } + /** + * Test case for fakeHttpSignatureTest + * + * test http signature authentication. + * + */ + public function testFakeHttpSignatureTest() + { + } + /** * Test case for fakeOuterBooleanSerialize * diff --git a/samples/openapi3/client/petstore/python/README.md b/samples/openapi3/client/petstore/python/README.md index 2c3dd373c6..2cf7fdb963 100644 --- a/samples/openapi3/client/petstore/python/README.md +++ b/samples/openapi3/client/petstore/python/README.md @@ -46,7 +46,7 @@ Please follow the [installation procedure](#installation--usage) and then run th ```python from __future__ import print_function - +import datetime import time import petstore_api from petstore_api.rest import ApiException @@ -84,6 +84,7 @@ 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* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -201,6 +202,10 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +## http_signature_test + + + ## petstore_auth - **Type**: OAuth diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 2ae2daf4bb..cf1e1179db 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -76,6 +77,69 @@ 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_http_signature_test** +> fake_http_signature_test(pet, query_1=query_1, header_1=header_1) + +test http signature authentication + +### Example + +```python +from __future__ import print_function +import time +import petstore_api +from petstore_api.rest import ApiException +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() as api_client: + # Create an instance of the API class + api_instance = petstore_api.FakeApi(api_client) + pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store +query_1 = 'query_1_example' # str | query parameter (optional) +header_1 = 'header_1_example' # str | header parameter (optional) + + try: + # test http signature authentication + api_instance.fake_http_signature_test(pet, query_1=query_1, header_1=header_1) + except ApiException as e: + print("Exception when calling FakeApi->fake_http_signature_test: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **str**| query parameter | [optional] + **header_1** | **str**| header parameter | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The instance started successfully | - | + +[[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_outer_boolean_serialize** > bool fake_outer_boolean_serialize(body=body) 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 66c7d5d7a7..71be34c74b 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 @@ -139,6 +139,128 @@ class FakeApi(object): _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats) + def fake_http_signature_test(self, pet, **kwargs): # noqa: E501 + """test http signature authentication # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_http_signature_test(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet pet: Pet object that needs to be added to the store (required) + :param str query_1: query parameter + :param str header_1: header parameter + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_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. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.fake_http_signature_test_with_http_info(pet, **kwargs) # noqa: E501 + + def fake_http_signature_test_with_http_info(self, pet, **kwargs): # noqa: E501 + """test http signature authentication # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.fake_http_signature_test_with_http_info(pet, async_req=True) + >>> result = thread.get() + + :param async_req bool: execute request asynchronously + :param Pet pet: Pet object that needs to be added to the store (required) + :param str query_1: query parameter + :param str header_1: header parameter + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_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. + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [ + 'pet', + 'query_1', + 'header_1' + ] + all_params.extend( + [ + 'async_req', + '_return_http_data_only', + '_preload_content', + '_request_timeout' + ] + ) + + for key, val in six.iteritems(local_var_params['kwargs']): + if key not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" + " to method fake_http_signature_test" % key + ) + local_var_params[key] = val + del local_var_params['kwargs'] + # verify the required parameter 'pet' is set + if self.api_client.client_side_validation and ('pet' not in local_var_params or # noqa: E501 + local_var_params['pet'] is None): # noqa: E501 + raise ApiValueError("Missing the required parameter `pet` when calling `fake_http_signature_test`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + 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 = {} + if 'header_1' in local_var_params: + header_params['header_1'] = local_var_params['header_1'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'pet' in local_var_params: + body_params = local_var_params['pet'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json', 'application/xml']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/fake/http-signature-test', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats) + def fake_outer_boolean_serialize(self, **kwargs): # noqa: E501 """fake_outer_boolean_serialize # noqa: E501 diff --git a/samples/openapi3/client/petstore/python/petstore_api/configuration.py b/samples/openapi3/client/petstore/python/petstore_api/configuration.py index 915a079502..92c53fb54e 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/configuration.py +++ b/samples/openapi3/client/petstore/python/petstore_api/configuration.py @@ -49,6 +49,8 @@ class Configuration(object): 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 signing_info: Configuration parameters for the HTTP signature security scheme. + Must be an instance of petstore_api.signing.HttpSigningConfiguration :Example: @@ -86,6 +88,45 @@ conf = petstore_api.Configuration( 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 @@ -94,6 +135,7 @@ conf = petstore_api.Configuration( api_key=None, api_key_prefix=None, username=None, password=None, discard_unknown_keys=False, + signing_info=None, ): """Constructor """ @@ -124,6 +166,11 @@ conf = petstore_api.Configuration( """Password for HTTP basic authentication """ self.discard_unknown_keys = discard_unknown_keys + 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 """ @@ -205,6 +252,10 @@ conf = petstore_api.Configuration( def __setattr__(self, name, value): object.__setattr__(self, name, value) + 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): @@ -382,6 +433,13 @@ conf = petstore_api.Configuration( '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', diff --git a/samples/openapi3/client/petstore/ruby-faraday/README.md b/samples/openapi3/client/petstore/ruby-faraday/README.md index c23142438a..719039e531 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/README.md +++ b/samples/openapi3/client/petstore/ruby-faraday/README.md @@ -78,6 +78,7 @@ Class | Method | HTTP request | Description *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -193,6 +194,9 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +### http_signature_test + + ### petstore_auth diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md index e29e28ea1a..a8256c46dd 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -62,6 +63,56 @@ No authorization required - **Accept**: application/json +## fake_http_signature_test + +> fake_http_signature_test(pet, opts) + +test http signature authentication + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} + +begin + #test http signature authentication + api_instance.fake_http_signature_test(pet, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **String**| query parameter | [optional] + **header_1** | **String**| header parameter | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + ## fake_outer_boolean_serialize > Boolean fake_outer_boolean_serialize(opts) diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index db53effcf9..26194b07ed 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -73,6 +73,72 @@ module Petstore return data, status_code, headers end + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + def fake_http_signature_test(pet, opts = {}) + fake_http_signature_test_with_http_info(pet, opts) + nil + end + + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fake_http_signature_test_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" + end + # resource path + local_var_path = '/fake/http-signature-test' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Test serialization of outer boolean types # @param [Hash] opts the optional parameters # @option opts [Boolean] :body Input boolean as post body diff --git a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb index 242cbc4325..93956dd227 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/spec/api/fake_api_spec.rb @@ -42,6 +42,19 @@ describe 'FakeApi' do end end + # unit tests for fake_http_signature_test + # test http signature authentication + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + describe 'fake_http_signature_test test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for fake_outer_boolean_serialize # Test serialization of outer boolean types # @param [Hash] opts the optional parameters diff --git a/samples/openapi3/client/petstore/ruby/README.md b/samples/openapi3/client/petstore/ruby/README.md index c23142438a..719039e531 100644 --- a/samples/openapi3/client/petstore/ruby/README.md +++ b/samples/openapi3/client/petstore/ruby/README.md @@ -78,6 +78,7 @@ Class | Method | HTTP request | Description *Petstore::AnotherFakeApi* | [**call_123_test_special_tags**](docs/AnotherFakeApi.md#call_123_test_special_tags) | **PATCH** /another-fake/dummy | To test special tags *Petstore::DefaultApi* | [**foo_get**](docs/DefaultApi.md#foo_get) | **GET** /foo | *Petstore::FakeApi* | [**fake_health_get**](docs/FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +*Petstore::FakeApi* | [**fake_http_signature_test**](docs/FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication *Petstore::FakeApi* | [**fake_outer_boolean_serialize**](docs/FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | *Petstore::FakeApi* | [**fake_outer_composite_serialize**](docs/FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | *Petstore::FakeApi* | [**fake_outer_number_serialize**](docs/FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -193,6 +194,9 @@ Class | Method | HTTP request | Description - **Type**: HTTP basic authentication +### http_signature_test + + ### petstore_auth diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md index e29e28ea1a..a8256c46dd 100644 --- a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md @@ -5,6 +5,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**fake_health_get**](FakeApi.md#fake_health_get) | **GET** /fake/health | Health check endpoint +[**fake_http_signature_test**](FakeApi.md#fake_http_signature_test) | **GET** /fake/http-signature-test | test http signature authentication [**fake_outer_boolean_serialize**](FakeApi.md#fake_outer_boolean_serialize) | **POST** /fake/outer/boolean | [**fake_outer_composite_serialize**](FakeApi.md#fake_outer_composite_serialize) | **POST** /fake/outer/composite | [**fake_outer_number_serialize**](FakeApi.md#fake_outer_number_serialize) | **POST** /fake/outer/number | @@ -62,6 +63,56 @@ No authorization required - **Accept**: application/json +## fake_http_signature_test + +> fake_http_signature_test(pet, opts) + +test http signature authentication + +### Example + +```ruby +# load the gem +require 'petstore' + +api_instance = Petstore::FakeApi.new +pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store +opts = { + query_1: 'query_1_example', # String | query parameter + header_1: 'header_1_example' # String | header parameter +} + +begin + #test http signature authentication + api_instance.fake_http_signature_test(pet, opts) +rescue Petstore::ApiError => e + puts "Exception when calling FakeApi->fake_http_signature_test: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query_1** | **String**| query parameter | [optional] + **header_1** | **String**| header parameter | [optional] + +### Return type + +nil (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + ## fake_outer_boolean_serialize > Boolean fake_outer_boolean_serialize(opts) diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index db53effcf9..26194b07ed 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -73,6 +73,72 @@ module Petstore return data, status_code, headers end + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + def fake_http_signature_test(pet, opts = {}) + fake_http_signature_test_with_http_info(pet, opts) + nil + end + + # test http signature authentication + # @param pet [Pet] Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def fake_http_signature_test_with_http_info(pet, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: FakeApi.fake_http_signature_test ...' + end + # verify the required parameter 'pet' is set + if @api_client.config.client_side_validation && pet.nil? + fail ArgumentError, "Missing the required parameter 'pet' when calling FakeApi.fake_http_signature_test" + end + # resource path + local_var_path = '/fake/http-signature-test' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query_1'] = opts[:'query_1'] if !opts[:'query_1'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'application/xml']) + header_params[:'header_1'] = opts[:'header_1'] if !opts[:'header_1'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(pet) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || [] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: FakeApi#fake_http_signature_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Test serialization of outer boolean types # @param [Hash] opts the optional parameters # @option opts [Boolean] :body Input boolean as post body diff --git a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb index 242cbc4325..93956dd227 100644 --- a/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/api/fake_api_spec.rb @@ -42,6 +42,19 @@ describe 'FakeApi' do end end + # unit tests for fake_http_signature_test + # test http signature authentication + # @param pet Pet object that needs to be added to the store + # @param [Hash] opts the optional parameters + # @option opts [String] :query_1 query parameter + # @option opts [String] :header_1 header parameter + # @return [nil] + describe 'fake_http_signature_test test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for fake_outer_boolean_serialize # Test serialization of outer boolean types # @param [Hash] opts the optional parameters diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index fe96bc3730..9d984b5090 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -16,6 +16,7 @@ import org.openapitools.model.HealthCheckResult; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.Map; @@ -75,6 +76,20 @@ public class FakeApi { throws NotFoundException { return delegate.fakeHealthGet(securityContext); } + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + + @io.swagger.annotations.ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) }) + public Response fakeHttpSignatureTest(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet +,@ApiParam(value = "query parameter") @QueryParam("query_1") String query1 +,@ApiParam(value = "header parameter" )@HeaderParam("header_1") String header1 +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.fakeHttpSignatureTest(pet, query1, header1, securityContext); + } @POST @Path("/outer/boolean") @Consumes({ "application/json" }) diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java index ffb6a868cd..6c6878f896 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApiService.java @@ -14,6 +14,7 @@ import org.openapitools.model.HealthCheckResult; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -27,6 +28,7 @@ import javax.validation.constraints.*; public abstract class FakeApiService { public abstract Response fakeHealthGet(SecurityContext securityContext) throws NotFoundException; + public abstract Response fakeHttpSignatureTest(Pet pet,String query1,String header1,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterBooleanSerialize(Boolean body,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterCompositeSerialize(OuterComposite outerComposite,SecurityContext securityContext) throws NotFoundException; public abstract Response fakeOuterNumberSerialize(BigDecimal body,SecurityContext securityContext) throws NotFoundException; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java index 6e2fb3f06f..860002084e 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java @@ -12,6 +12,7 @@ import org.openapitools.model.HealthCheckResult; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.openapitools.model.Pet; import org.openapitools.model.User; import java.util.List; @@ -32,6 +33,11 @@ public class FakeApiServiceImpl extends FakeApiService { return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); } @Override + public Response fakeHttpSignatureTest(Pet pet, String query1, String header1, SecurityContext securityContext) throws NotFoundException { + // do some magic! + return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); + } + @Override public Response fakeOuterBooleanSerialize(Boolean body, SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); From db5941379f1b6d55075a7a8d85b63cde3e149eb8 Mon Sep 17 00:00:00 2001 From: Justin Niessner Date: Sun, 26 Apr 2020 16:33:42 -0400 Subject: [PATCH 20/25] [Python] Fix Python UTF-8 Encoding Issue (#5679) * Try decoding but don't bail on error * Switch binary and ByteArray to bytes * Read content type and parse appropriately * Remove response parsing * Remove response parsing and just return the data * Update petshop examples w/ new generator code * Fix copy/paste error with naming * Update petstore examples * Move response decoding to inside _preload_content block * Update the clients again * Use a raw string for the regex pattern * Regenerate petstore clients * Add bytes to python primitives as it's supported in 2.7 and 3 * Add bytes to the exports from model_utils * Import bytes from model_utils * Add conditional typing for regex pattern to match variable type * Regenerate petstore clients * Use read() instead of text() for asyncio * Regenerate petstore clients * Remove unused six import * Regenerate petstore clients * Add newline to kick Circle to re-run * Remove whitespace from tox.ini * Update more examples after ensure_updated * Add sample updates that didn't run with the --batch flag * Remove extra bracket in regex to remove warning * Stop printing debug messages * Add bytes examples to python doc generators * Update generated FakeApi docs * Regenerate api_client.py * Remove print statements from generated clients * Update bytes example in FakeApi.md. Again. I swear. * Add yet another seemingly missing doc update * Catch the error, decode the body, and re-throw * Remove the updates now that the change is non-breaking * Regenerate client * Add bytes deserialization test * Update exception parsing * Add exception parsing for python-experimental * Regenerate client with minor changes * Revert test changes * Regenerate model_utils.py * Update confusing test name * Remove bytes from mapping and examples * Add back in the old binary/ByteArray to str mapping * Update docs and api_client template * Add experimental api_client changes * Regenerate samples again * Add Tornado handling to early return * Try fixing Tornado python returns * More documentation changes * Re-generate the client code * Remove bytes from test_format_test * Remove more leftover bytes usages * Switch bytes validation back to string * Fix format_test template and regenerate * Remove unused bytes var * Remove bytes import from models and regenerate * Remove bytes import from test_deserialization * Reduce nested ifs * Remove byte logic for now * Regenerate client after latest changes * Remove another bytes usage * Regenerate after removing dangling byte string usage * Reduce the scope of the try/catch in api_client * Regenerate after try/catch cleanup * Swap catch for except * Regenerate Python client after api_client change * Fix lint error on the generated api_client * Add binary format test back in w/ string * Add decoding to python-experimental and regenerate * Import re into python-experimental api_client * Ensure file upload json response is utf-8 encoded bytes --- docs/generators/python-experimental.md | 1 + docs/generators/python.md | 1 + .../languages/PythonClientCodegen.java | 3 +- .../PythonClientExperimentalCodegen.java | 4 +- .../main/resources/python/api_client.mustache | 47 ++++++++++----- .../resources/python/asyncio/rest.mustache | 2 +- .../python-experimental/api_client.mustache | 57 +++++++++++++------ .../src/main/resources/python/rest.mustache | 5 -- .../resources/python/tornado/rest.mustache | 7 +-- .../python-asyncio/petstore_api/api_client.py | 42 +++++++++----- .../python-asyncio/petstore_api/rest.py | 2 +- .../petstore_api/api_client.py | 52 +++++++++++------ .../python-experimental/petstore_api/rest.py | 5 -- .../test/test_format_test.py | 2 +- .../tests/test_api_exception.py | 1 + .../tests/test_deserialization.py | 30 ++++++++++ .../python-experimental/tests/test_pet_api.py | 2 +- .../python-tornado/petstore_api/api_client.py | 42 +++++++++----- .../python-tornado/petstore_api/rest.py | 7 +-- .../python/petstore_api/api_client.py | 42 +++++++++----- .../petstore/python/petstore_api/rest.py | 5 -- .../petstore/python/test/test_format_test.py | 26 ++++----- .../python/tests/test_api_exception.py | 1 + .../petstore_api/api_client.py | 52 +++++++++++------ .../python-experimental/petstore_api/rest.py | 5 -- .../python/petstore_api/api_client.py | 42 +++++++++----- .../petstore/python/petstore_api/rest.py | 5 -- .../php-slim4/lib/Model/EnumClass.php | 4 +- 28 files changed, 319 insertions(+), 175 deletions(-) diff --git a/docs/generators/python-experimental.md b/docs/generators/python-experimental.md index 8f3b02c7e5..546dcc2254 100644 --- a/docs/generators/python-experimental.md +++ b/docs/generators/python-experimental.md @@ -31,6 +31,7 @@ sidebar_label: python-experimental
    • bool
    • +
    • bytes
    • date
    • datetime
    • dict
    • diff --git a/docs/generators/python.md b/docs/generators/python.md index 3bd96b865b..7c4ff80016 100644 --- a/docs/generators/python.md +++ b/docs/generators/python.md @@ -31,6 +31,7 @@ sidebar_label: python
      • bool
      • +
      • bytes
      • date
      • datetime
      • dict
      • 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 ca59f763d7..077676af99 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 @@ -119,6 +119,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig languageSpecificPrimitives.add("object"); // TODO file and binary is mapped as `file` languageSpecificPrimitives.add("file"); + languageSpecificPrimitives.add("bytes"); typeMapping.clear(); typeMapping.put("integer", "int"); @@ -828,7 +829,7 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig if (schema.getDiscriminator()!=null) { toExclude = schema.getDiscriminator().getPropertyName(); } - + example = packageName + ".models." + underscore(schema.getTitle())+"."+schema.getTitle()+"("; // if required only: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java index 6aa9c08250..60a004b6be 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientExperimentalCodegen.java @@ -884,8 +884,8 @@ public class PythonClientExperimentalCodegen extends PythonClientCodegen { * Return a string representation of the Python types for the specified 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. - * + * Composed types (e.g. allAll, oneOf, anyOf) are represented in Python using list of types. + * * @param p The OAS schema. * @param prefix prepended to the returned value. * @param suffix appended to the returned value. 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 de25b7cf97..66d3577f3c 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -22,7 +22,7 @@ import tornado.gen from {{packageName}}.configuration import Configuration import {{modelPackage}} from {{packageName}} import rest -from {{packageName}}.exceptions import ApiValueError +from {{packageName}}.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -186,22 +186,43 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + {{^tornado}} + return return_data + {{/tornado}} + {{#tornado}} + raise tornado.gen.Return(return_data) + {{/tornado}} + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None {{^tornado}} if _return_http_data_only: 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 f2099c7531..44531fce5a 100644 --- a/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/asyncio/rest.mustache @@ -166,7 +166,7 @@ class RESTClientObject(object): r = await self.pool_manager.request(**args) if _preload_content: - data = await r.text() + data = await r.read() r = RESTResponse(r, data) # log response body diff --git a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache index 774dae89c6..5285a7b806 100644 --- a/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/python-experimental/api_client.mustache @@ -7,6 +7,7 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool import os +import re # python 2 and python 3 compatibility library import six @@ -17,7 +18,7 @@ import tornado.gen from {{packageName}} import rest from {{packageName}}.configuration import Configuration -from {{packageName}}.exceptions import ApiValueError +from {{packageName}}.exceptions import ApiValueError, ApiException from {{packageName}}.model_utils import ( ModelNormal, ModelSimple, @@ -176,26 +177,48 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = {{#asyncio}}await {{/asyncio}}{{#tornado}}yield {{/tornado}}self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None + + if not _preload_content: + {{^tornado}} + return (return_data) + {{/tornado}} + {{#tornado}} + raise tornado.gen.Return(return_data) + {{/tornado}} + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None {{^tornado}} if _return_http_data_only: diff --git a/modules/openapi-generator/src/main/resources/python/rest.mustache b/modules/openapi-generator/src/main/resources/python/rest.mustache index 772efe91b3..fe7abfdfc0 100644 --- a/modules/openapi-generator/src/main/resources/python/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/rest.mustache @@ -209,11 +209,6 @@ class RESTClientObject(object): if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache b/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache index e7a760f370..2679760ea5 100644 --- a/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache +++ b/modules/openapi-generator/src/main/resources/python/tornado/rest.mustache @@ -8,7 +8,6 @@ import logging import re # python 2 and python 3 compatibility library -import six from six.moves.urllib.parse import urlencode import tornado import tornado.gen @@ -28,11 +27,7 @@ class RESTResponse(io.IOBase): self.reason = resp.reason if resp.body: - # In Python 3, the response body is utf-8 encoded bytes. - if six.PY3: - self.data = resp.body.decode('utf-8') - else: - self.data = resp.body + self.data = resp.body else: self.data = None diff --git a/samples/client/petstore/python-asyncio/petstore_api/api_client.py b/samples/client/petstore/python-asyncio/petstore_api/api_client.py index 8aae783bfc..7e0d28cd4c 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/api_client.py +++ b/samples/client/petstore/python-asyncio/petstore_api/api_client.py @@ -27,7 +27,7 @@ from six.moves.urllib.parse import quote from petstore_api.configuration import Configuration import petstore_api.models from petstore_api import rest -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -177,22 +177,38 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = await self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = await self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: return (return_data) diff --git a/samples/client/petstore/python-asyncio/petstore_api/rest.py b/samples/client/petstore/python-asyncio/petstore_api/rest.py index 1394af356b..9310b9dfde 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/rest.py +++ b/samples/client/petstore/python-asyncio/petstore_api/rest.py @@ -174,7 +174,7 @@ class RESTClientObject(object): r = await self.pool_manager.request(**args) if _preload_content: - data = await r.text() + data = await r.read() r = RESTResponse(r, data) # log response body diff --git a/samples/client/petstore/python-experimental/petstore_api/api_client.py b/samples/client/petstore/python-experimental/petstore_api/api_client.py index 2e9d94da16..3983332681 100644 --- a/samples/client/petstore/python-experimental/petstore_api/api_client.py +++ b/samples/client/petstore/python-experimental/petstore_api/api_client.py @@ -15,6 +15,7 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool import os +import re # python 2 and python 3 compatibility library import six @@ -22,7 +23,7 @@ from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException from petstore_api.model_utils import ( ModelNormal, ModelSimple, @@ -178,26 +179,43 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None + + if not _preload_content: + return (return_data) + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None if _return_http_data_only: return (return_data) diff --git a/samples/client/petstore/python-experimental/petstore_api/rest.py b/samples/client/petstore/python-experimental/petstore_api/rest.py index 7ed815b8a1..973161ca7a 100644 --- a/samples/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/client/petstore/python-experimental/petstore_api/rest.py @@ -217,11 +217,6 @@ class RESTClientObject(object): if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/samples/client/petstore/python-experimental/test/test_format_test.py b/samples/client/petstore/python-experimental/test/test_format_test.py index ed926aa031..e7a32e3253 100644 --- a/samples/client/petstore/python-experimental/test/test_format_test.py +++ b/samples/client/petstore/python-experimental/test/test_format_test.py @@ -150,4 +150,4 @@ class TestFormatTest(unittest.TestCase): if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/samples/client/petstore/python-experimental/tests/test_api_exception.py b/samples/client/petstore/python-experimental/tests/test_api_exception.py index 026ba5bd79..b26ef5252b 100644 --- a/samples/client/petstore/python-experimental/tests/test_api_exception.py +++ b/samples/client/petstore/python-experimental/tests/test_api_exception.py @@ -10,6 +10,7 @@ $ nosetests -v """ import os +import six import sys import unittest diff --git a/samples/client/petstore/python-experimental/tests/test_deserialization.py b/samples/client/petstore/python-experimental/tests/test_deserialization.py index 8ebeb1751c..83ecabe81d 100644 --- a/samples/client/petstore/python-experimental/tests/test_deserialization.py +++ b/samples/client/petstore/python-experimental/tests/test_deserialization.py @@ -377,6 +377,36 @@ class DeserializationTests(unittest.TestCase): finally: os.unlink(file_path) + def test_deserialize_binary_to_str(self): + """Ensures that bytes deserialization works""" + response_types_mixed = (str,) + + # sample from http://www.jtricks.com/download-text + HTTPResponse = namedtuple( + 'urllib3_response_HTTPResponse', + ['status', 'reason', 'data', 'getheaders', 'getheader'] + ) + headers = {} + def get_headers(): + return headers + def get_header(name, default=None): + return headers.get(name, default) + data = "str" + + http_response = HTTPResponse( + status=200, + reason='OK', + data=json.dumps(data).encode("utf-8") if six.PY3 else json.dumps(data), + getheaders=get_headers, + getheader=get_header + ) + + mock_response = RESTResponse(http_response) + + result = self.deserialize(mock_response, response_types_mixed, True) + self.assertEqual(isinstance(result, str), True) + self.assertEqual(result, data) + def test_deserialize_string_boolean_map(self): """ Ensures that string boolean (additional properties) diff --git a/samples/client/petstore/python-experimental/tests/test_pet_api.py b/samples/client/petstore/python-experimental/tests/test_pet_api.py index 919d250542..ee7e53ecad 100644 --- a/samples/client/petstore/python-experimental/tests/test_pet_api.py +++ b/samples/client/petstore/python-experimental/tests/test_pet_api.py @@ -329,7 +329,7 @@ class PetApiTests(unittest.TestCase): http_response = HTTPResponse( status=200, reason='OK', - data=json.dumps(api_respponse), + data=json.dumps(api_respponse).encode('utf-8'), getheaders=get_headers, getheader=get_header ) diff --git a/samples/client/petstore/python-tornado/petstore_api/api_client.py b/samples/client/petstore/python-tornado/petstore_api/api_client.py index 328c1a70e1..3fc10d72ab 100644 --- a/samples/client/petstore/python-tornado/petstore_api/api_client.py +++ b/samples/client/petstore/python-tornado/petstore_api/api_client.py @@ -28,7 +28,7 @@ import tornado.gen from petstore_api.configuration import Configuration import petstore_api.models from petstore_api import rest -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -178,22 +178,38 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = yield self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = yield self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + raise tornado.gen.Return(return_data) + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: raise tornado.gen.Return(return_data) diff --git a/samples/client/petstore/python-tornado/petstore_api/rest.py b/samples/client/petstore/python-tornado/petstore_api/rest.py index d5661febf4..f3f274480a 100644 --- a/samples/client/petstore/python-tornado/petstore_api/rest.py +++ b/samples/client/petstore/python-tornado/petstore_api/rest.py @@ -16,7 +16,6 @@ import logging import re # python 2 and python 3 compatibility library -import six from six.moves.urllib.parse import urlencode import tornado import tornado.gen @@ -36,11 +35,7 @@ class RESTResponse(io.IOBase): self.reason = resp.reason if resp.body: - # In Python 3, the response body is utf-8 encoded bytes. - if six.PY3: - self.data = resp.body.decode('utf-8') - else: - self.data = resp.body + self.data = resp.body else: self.data = None diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index a80084e04b..7b1b0010a4 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -27,7 +27,7 @@ from six.moves.urllib.parse import quote from petstore_api.configuration import Configuration import petstore_api.models from petstore_api import rest -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -176,22 +176,38 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: return (return_data) diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index 7ed815b8a1..973161ca7a 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -217,11 +217,6 @@ class RESTClientObject(object): if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/samples/client/petstore/python/test/test_format_test.py b/samples/client/petstore/python/test/test_format_test.py index 70255fccd1..e64c47b385 100644 --- a/samples/client/petstore/python/test/test_format_test.py +++ b/samples/client/petstore/python/test/test_format_test.py @@ -36,19 +36,19 @@ class TestFormatTest(unittest.TestCase): # model = petstore_api.models.format_test.FormatTest() # noqa: E501 if include_optional : return FormatTest( - integer = 1E+1, - int32 = 2E+1, - int64 = 56, - number = 32.1, - float = 54.3, - double = 67.8, - string = 'a', - byte = 'YQ==', - binary = bytes(b'blah'), - date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), - date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84', - password = '0123456789', + integer = 1E+1, + int32 = 2E+1, + int64 = 56, + number = 32.1, + float = 54.3, + double = 67.8, + string = 'a', + byte = 'YQ==', + binary = 'bytes', + date = datetime.datetime.strptime('1975-12-30', '%Y-%m-%d').date(), + date_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + uuid = '72f98069-206d-4f12-9f12-3d1e525a8e84', + password = '0123456789', big_decimal = 1 ) else : diff --git a/samples/client/petstore/python/tests/test_api_exception.py b/samples/client/petstore/python/tests/test_api_exception.py index 75bf81a8de..b076628c0a 100644 --- a/samples/client/petstore/python/tests/test_api_exception.py +++ b/samples/client/petstore/python/tests/test_api_exception.py @@ -10,6 +10,7 @@ $ nosetests -v """ import os +import six import sys import unittest 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 544a21c79d..1edccecef6 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 @@ -15,6 +15,7 @@ import atexit import mimetypes from multiprocessing.pool import ThreadPool import os +import re # python 2 and python 3 compatibility library import six @@ -22,7 +23,7 @@ from six.moves.urllib.parse import quote from petstore_api import rest from petstore_api.configuration import Configuration -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException from petstore_api.model_utils import ( ModelNormal, ModelSimple, @@ -178,26 +179,43 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) - else: - return_data = None + + if not _preload_content: + return (return_data) + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize( + response_data, + response_type, + _check_type + ) + else: + return_data = None if _return_http_data_only: return (return_data) diff --git a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py index 7ed815b8a1..973161ca7a 100644 --- a/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python-experimental/petstore_api/rest.py @@ -217,11 +217,6 @@ class RESTClientObject(object): if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) 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 a80084e04b..7b1b0010a4 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -27,7 +27,7 @@ from six.moves.urllib.parse import quote from petstore_api.configuration import Configuration import petstore_api.models from petstore_api import rest -from petstore_api.exceptions import ApiValueError +from petstore_api.exceptions import ApiValueError, ApiException class ApiClient(object): @@ -176,22 +176,38 @@ class ApiClient(object): # use server/host defined in path or operation instead url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + try: + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + except ApiException as e: + e.body = e.body.decode('utf-8') if six.PY3 else e.body + raise e + + content_type = response_data.getheader('content-type') self.last_response = response_data return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None + + if not _preload_content: + return return_data + + if six.PY3 and response_type not in ["file", "bytes"]: + match = None + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_data.data = response_data.data.decode(encoding) + + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None if _return_http_data_only: return (return_data) diff --git a/samples/openapi3/client/petstore/python/petstore_api/rest.py b/samples/openapi3/client/petstore/python/petstore_api/rest.py index 7ed815b8a1..973161ca7a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/rest.py +++ b/samples/openapi3/client/petstore/python/petstore_api/rest.py @@ -217,11 +217,6 @@ class RESTClientObject(object): if _preload_content: r = RESTResponse(r) - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - # log response body logger.debug("response body: %s", r.data) diff --git a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php index 3ddd829b31..c3998d8602 100644 --- a/samples/server/petstore/php-slim4/lib/Model/EnumClass.php +++ b/samples/server/petstore/php-slim4/lib/Model/EnumClass.php @@ -30,8 +30,8 @@ class EnumClass implements ModelInterface private const MODEL_SCHEMA = <<<'SCHEMA' { "type" : "string", - "default" : "-efg", - "enum" : [ "_abc", "-efg", "(xyz)" ] + "enum" : [ "_abc", "-efg", "(xyz)" ], + "default" : "-efg" } SCHEMA; From 3b0bd368a6e101d844d47220686674e0ff16550b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 28 Apr 2020 00:09:14 +0800 Subject: [PATCH 21/25] Update Java (feign) client dependency (#6068) * update feign dependency * update feign samples --- .../libraries/feign/build.gradle.mustache | 4 ++-- .../Java/libraries/feign/build.sbt.mustache | 8 +++---- .../Java/libraries/feign/pom.mustache | 24 +++++++++++++++---- .../client/petstore/java/feign/build.gradle | 2 +- samples/client/petstore/java/feign/build.sbt | 2 +- samples/client/petstore/java/feign/pom.xml | 22 ++++++++++++++--- .../petstore/java/feign10x/build.gradle | 4 ++-- .../client/petstore/java/feign10x/build.sbt | 8 +++---- samples/client/petstore/java/feign10x/pom.xml | 24 +++++++++++++++---- 9 files changed, 73 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 2a6c4c79fb..86cdad95f8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -119,14 +119,14 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" jackson_databind_nullable_version = "0.2.1" {{#threetenbp}} jackson_threetenbp_version = "2.9.10" {{/threetenbp}} - feign_version = "{{#useFeign10}}10.7.4{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" + feign_version = "{{#useFeign10}}11.0{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" feign_form_version = "{{#useFeign10}}3.8.0{{/useFeign10}}{{^useFeign10}}2.1.0{{/useFeign10}}" junit_version = "4.13" oltu_version = "1.0.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index 8fa1d345b2..cd55527b8e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -9,10 +9,10 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.22" % "compile", - "io.github.openfeign" % "feign-core" % "{{#useFeign10}}10.7.4{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", - "io.github.openfeign" % "feign-jackson" % "{{#useFeign10}}10.7.4{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", - "io.github.openfeign" % "feign-slf4j" % "{{#useFeign10}}10.7.4{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "io.github.openfeign" % "feign-core" % "{{#useFeign10}}11.0{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", + "io.github.openfeign" % "feign-jackson" % "{{#useFeign10}}11.0{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", + "io.github.openfeign" % "feign-slf4j" % "{{#useFeign10}}11.0{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}}" % "compile", "io.github.openfeign.form" % "feign-form" % "{{#useFeign10}}3.8.0{{/useFeign10}}{{^useFeign10}}2.1.0{{/useFeign10}}" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 86f6f39778..a40806b32e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -63,7 +63,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.0.0-M4 @@ -73,7 +73,7 @@ -Xms512m -Xmx1500m methods - pertest + 10 @@ -139,6 +139,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + org.apache.maven.plugins maven-javadoc-plugin @@ -314,8 +330,8 @@ {{#supportJava6}}1.6{{/supportJava6}}{{^supportJava6}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/supportJava6}} ${java.version} ${java.version} - 1.5.21 - {{#useFeign10}}10.7.4{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}} + 1.5.24 + {{#useFeign10}}11.0{{/useFeign10}}{{^useFeign10}}9.7.0{{/useFeign10}} {{#useFeign10}}3.8.0{{/useFeign10}}{{^useFeign10}}2.1.0{{/useFeign10}} 2.10.3 0.2.1 diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index b44f6694d1..4768524c68 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -95,7 +95,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" jackson_databind_nullable_version = "0.2.1" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index 4e32526ee1..f706a6d486 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -9,7 +9,7 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.22" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", "io.github.openfeign" % "feign-core" % "9.7.0" % "compile", "io.github.openfeign" % "feign-jackson" % "9.7.0" % "compile", "io.github.openfeign" % "feign-slf4j" % "9.7.0" % "compile", diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index f8b07f983a..5e288b31a4 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.0.0-M4 @@ -66,7 +66,7 @@ -Xms512m -Xmx1500m methods - pertest + 10 @@ -132,6 +132,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + org.apache.maven.plugins maven-javadoc-plugin @@ -281,7 +297,7 @@ 1.7 ${java.version} ${java.version} - 1.5.21 + 1.5.24 9.7.0 2.1.0 2.10.3 diff --git a/samples/client/petstore/java/feign10x/build.gradle b/samples/client/petstore/java/feign10x/build.gradle index a559aaf0b0..5d8ed83e60 100644 --- a/samples/client/petstore/java/feign10x/build.gradle +++ b/samples/client/petstore/java/feign10x/build.gradle @@ -95,12 +95,12 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" jackson_databind_nullable_version = "0.2.1" jackson_threetenbp_version = "2.9.10" - feign_version = "10.7.4" + feign_version = "11.0" feign_form_version = "3.8.0" junit_version = "4.13" oltu_version = "1.0.1" diff --git a/samples/client/petstore/java/feign10x/build.sbt b/samples/client/petstore/java/feign10x/build.sbt index 2ef42df48c..ff7f74d335 100644 --- a/samples/client/petstore/java/feign10x/build.sbt +++ b/samples/client/petstore/java/feign10x/build.sbt @@ -9,10 +9,10 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.22" % "compile", - "io.github.openfeign" % "feign-core" % "10.7.4" % "compile", - "io.github.openfeign" % "feign-jackson" % "10.7.4" % "compile", - "io.github.openfeign" % "feign-slf4j" % "10.7.4" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "io.github.openfeign" % "feign-core" % "11.0" % "compile", + "io.github.openfeign" % "feign-jackson" % "11.0" % "compile", + "io.github.openfeign" % "feign-slf4j" % "11.0" % "compile", "io.github.openfeign.form" % "feign-form" % "3.8.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3" % "compile", diff --git a/samples/client/petstore/java/feign10x/pom.xml b/samples/client/petstore/java/feign10x/pom.xml index 290f88e0ae..5cb786250a 100644 --- a/samples/client/petstore/java/feign10x/pom.xml +++ b/samples/client/petstore/java/feign10x/pom.xml @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.0.0-M4 @@ -66,7 +66,7 @@ -Xms512m -Xmx1500m methods - pertest + 10 @@ -132,6 +132,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + + + org.apache.maven.plugins maven-javadoc-plugin @@ -281,8 +297,8 @@ 1.7 ${java.version} ${java.version} - 1.5.21 - 10.7.4 + 1.5.24 + 11.0 3.8.0 2.10.3 0.2.1 From 588023686af0bffc161028df2612b27be50808fd Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 28 Apr 2020 00:09:30 +0800 Subject: [PATCH 22/25] Add HTTP signature authentication support to Java (jersey2-experimental) (#6058) * add fmt-maven-plugin to jersey2 exp * update samples * add http signature auth template * minor fix * fix http beaer auth, update sample * fix http signature auth * fix http signature auth * header support * add query string to path * undo changes in default codegen * ignore fake test * add serialize to string method * add serialzie to string method * add get mapper * auto format java source code * remove plugin * update pom.xml * change back AbstractOpenApiSchema to T * skip mvn code formatter in bin script * undo changes to spec * update samples * add back HttpSignatureAuth.java --- bin/java-petstore-jersey2-experimental.sh | 4 +- .../codegen/languages/JavaClientCodegen.java | 1 + .../jersey2-experimental/ApiClient.mustache | 79 +- .../jersey2-experimental/JSON.mustache | 2 + .../auth/ApiKeyAuth.mustache | 68 + .../auth/Authentication.mustache | 22 + .../auth/HttpBasicAuth.mustache | 62 + .../auth/HttpBearerAuth.mustache | 51 + .../auth/HttpSignatureAuth.mustache | 115 ++ .../jersey2-experimental/auth/OAuth.mustache | 30 + .../auth/OAuthFlow.mustache | 7 + .../jersey2-experimental/pom.mustache | 113 +- ...ith-fake-endpoints-models-for-testing.yaml | 2 +- .../jersey2-experimental/api/openapi.yaml | 1081 +++++++------ .../docs/AdditionalPropertiesClass.md | 13 +- .../docs/AnotherFakeApi.md | 8 +- .../jersey2-experimental/docs/DefaultApi.md | 68 + .../jersey2-experimental/docs/EnumTest.md | 3 + .../java/jersey2-experimental/docs/FakeApi.md | 156 +- .../docs/FakeClassnameTags123Api.md | 8 +- .../java/jersey2-experimental/docs/Foo.md | 12 + .../jersey2-experimental/docs/FormatTest.md | 3 +- .../docs/HealthCheckResult.md | 13 + .../jersey2-experimental/docs/InlineObject.md | 13 + .../docs/InlineObject1.md | 13 + .../docs/InlineObject2.md | 32 + .../docs/InlineObject3.md | 25 + .../docs/InlineObject4.md | 13 + .../docs/InlineObject5.md | 13 + .../docs/InlineResponseDefault.md | 12 + .../docs/NullableClass.md | 23 + .../docs/OuterEnumDefaultValue.md | 15 + .../docs/OuterEnumInteger.md | 15 + .../docs/OuterEnumIntegerDefaultValue.md | 15 + .../java/jersey2-experimental/docs/PetApi.md | 19 +- .../jersey2-experimental/docs/StoreApi.md | 10 +- .../java/jersey2-experimental/docs/UserApi.md | 40 +- .../java/jersey2-experimental/pom.xml | 41 +- .../org/openapitools/client/ApiClient.java | 466 ++++-- .../org/openapitools/client/ApiException.java | 130 +- .../org/openapitools/client/ApiResponse.java | 61 +- .../openapitools/client/Configuration.java | 42 +- .../client/CustomInstantDeserializer.java | 274 ++-- .../java/org/openapitools/client/JSON.java | 12 +- .../java/org/openapitools/client/Pair.java | 68 +- .../client/RFC3339DateFormat.java | 7 +- .../client/ServerConfiguration.java | 91 +- .../openapitools/client/ServerVariable.java | 31 +- .../org/openapitools/client/StringUtil.java | 13 +- .../client/api/AnotherFakeApi.java | 96 +- .../openapitools/client/api/DefaultApi.java | 94 ++ .../org/openapitools/client/api/FakeApi.java | 1351 ++++++++++------- .../client/api/FakeClassnameTags123Api.java | 96 +- .../org/openapitools/client/api/PetApi.java | 674 ++++---- .../org/openapitools/client/api/StoreApi.java | 307 ++-- .../org/openapitools/client/api/UserApi.java | 598 ++++---- .../openapitools/client/auth/ApiKeyAuth.java | 20 +- .../client/auth/Authentication.java | 33 +- .../client/auth/HttpBasicAuth.java | 27 +- .../client/auth/HttpBearerAuth.java | 31 +- .../client/auth/HttpSignatureAuth.java | 141 ++ .../org/openapitools/client/auth/OAuth.java | 20 +- .../openapitools/client/auth/OAuthFlow.java | 8 +- .../client/model/AbstractOpenApiSchema.java | 32 +- .../model/AdditionalPropertiesArray.java | 107 -- .../model/AdditionalPropertiesBoolean.java | 106 -- .../model/AdditionalPropertiesClass.java | 448 +----- .../model/AdditionalPropertiesInteger.java | 106 -- .../model/AdditionalPropertiesNumber.java | 107 -- .../org/openapitools/client/model/Animal.java | 60 +- .../model/ArrayOfArrayOfNumberOnly.java | 37 +- .../client/model/ArrayOfNumberOnly.java | 37 +- .../openapitools/client/model/ArrayTest.java | 64 +- .../org/openapitools/client/model/BigCat.java | 145 -- .../client/model/BigCatAllOf.java | 141 -- .../client/model/Capitalization.java | 100 +- .../org/openapitools/client/model/Cat.java | 42 +- .../openapitools/client/model/CatAllOf.java | 37 +- .../openapitools/client/model/Category.java | 51 +- .../openapitools/client/model/ClassModel.java | 36 +- .../org/openapitools/client/model/Client.java | 37 +- .../org/openapitools/client/model/Dog.java | 42 +- .../openapitools/client/model/DogAllOf.java | 37 +- .../openapitools/client/model/EnumArrays.java | 64 +- .../openapitools/client/model/EnumClass.java | 16 +- .../openapitools/client/model/EnumTest.java | 237 ++- .../client/model/FileSchemaTestClass.java | 47 +- ...ditionalPropertiesString.java => Foo.java} | 73 +- .../openapitools/client/model/FormatTest.java | 287 ++-- .../client/model/HasOnlyReadOnly.java | 50 +- .../client/model/HealthCheckResult.java | 104 ++ ...opertiesAnyType.java => InlineObject.java} | 81 +- .../client/model/InlineObject1.java | 117 ++ .../client/model/InlineObject2.java | 198 +++ .../client/model/InlineObject3.java | 481 ++++++ .../client/model/InlineObject4.java | 111 ++ .../client/model/InlineObject5.java | 116 ++ ...Object.java => InlineResponseDefault.java} | 73 +- .../openapitools/client/model/MapTest.java | 78 +- ...ropertiesAndAdditionalPropertiesClass.java | 64 +- .../client/model/Model200Response.java | 46 +- .../client/model/ModelApiResponse.java | 59 +- .../client/model/ModelReturn.java | 36 +- .../org/openapitools/client/model/Name.java | 68 +- .../client/model/NullableClass.java | 612 ++++++++ .../openapitools/client/model/NumberOnly.java | 37 +- .../org/openapitools/client/model/Order.java | 107 +- .../client/model/OuterComposite.java | 59 +- .../openapitools/client/model/OuterEnum.java | 18 +- .../client/model/OuterEnumDefaultValue.java | 52 + .../client/model/OuterEnumInteger.java | 52 + .../model/OuterEnumIntegerDefaultValue.java | 52 + .../org/openapitools/client/model/Pet.java | 105 +- .../client/model/ReadOnlyFirst.java | 51 +- .../client/model/SpecialModelName.java | 45 +- .../org/openapitools/client/model/Tag.java | 51 +- .../client/model/TypeHolderDefault.java | 229 --- .../client/model/TypeHolderExample.java | 259 ---- .../org/openapitools/client/model/User.java | 119 +- .../openapitools/client/model/XmlItem.java | 1045 ------------- .../client/api/AnotherFakeApiTest.java | 48 +- .../client/api/DefaultApiTest.java | 29 + .../openapitools/client/api/FakeApiTest.java | 535 ++++--- .../api/FakeClassnameTags123ApiTest.java | 48 +- .../openapitools/client/api/PetApiTest.java | 286 ++-- .../openapitools/client/api/StoreApiTest.java | 133 +- .../openapitools/client/api/UserApiTest.java | 243 ++- .../AdditionalPropertiesAnyTypeTest.java | 51 - .../model/AdditionalPropertiesArrayTest.java | 52 - .../AdditionalPropertiesBooleanTest.java | 51 - .../model/AdditionalPropertiesClassTest.java | 131 +- .../AdditionalPropertiesIntegerTest.java | 51 - .../model/AdditionalPropertiesNumberTest.java | 52 - .../model/AdditionalPropertiesObjectTest.java | 51 - .../model/AdditionalPropertiesStringTest.java | 51 - .../openapitools/client/model/AnimalTest.java | 57 +- .../model/ArrayOfArrayOfNumberOnlyTest.java | 46 +- .../client/model/ArrayOfNumberOnlyTest.java | 46 +- .../client/model/ArrayTestTest.java | 70 +- .../client/model/BigCatAllOfTest.java | 49 - .../openapitools/client/model/BigCatTest.java | 75 - .../client/model/CapitalizationTest.java | 103 +- .../client/model/CatAllOfTest.java | 43 +- .../openapitools/client/model/CatTest.java | 69 +- .../client/model/CategoryTest.java | 55 +- .../client/model/ClassModelTest.java | 43 +- .../openapitools/client/model/ClientTest.java | 43 +- .../client/model/DogAllOfTest.java | 43 +- .../openapitools/client/model/DogTest.java | 69 +- .../client/model/EnumArraysTest.java | 57 +- .../client/model/EnumClassTest.java | 23 +- .../client/model/EnumTestTest.java | 108 +- .../client/model/FileSchemaTestClassTest.java | 57 +- .../openapitools/client/model/FooTest.java | 32 + .../client/model/FormatTestTest.java | 208 +-- .../client/model/HasOnlyReadOnlyTest.java | 55 +- .../client/model/HealthCheckResultTest.java | 32 + .../client/model/InlineObject1Test.java | 38 + .../client/model/InlineObject2Test.java | 38 + .../client/model/InlineObject3Test.java | 110 ++ .../client/model/InlineObject4Test.java | 38 + .../client/model/InlineObject5Test.java | 38 + .../client/model/InlineObjectTest.java | 38 + .../model/InlineResponseDefaultTest.java | 32 + .../client/model/MapTestTest.java | 82 +- ...rtiesAndAdditionalPropertiesClassTest.java | 74 +- .../client/model/Model200ResponseTest.java | 55 +- .../client/model/ModelApiResponseTest.java | 67 +- .../client/model/ModelReturnTest.java | 43 +- .../openapitools/client/model/NameTest.java | 79 +- .../client/model/NullableClassTest.java | 98 ++ .../client/model/NumberOnlyTest.java | 44 +- .../openapitools/client/model/OrderTest.java | 104 +- .../client/model/OuterCompositeTest.java | 68 +- .../model/OuterEnumDefaultValueTest.java | 24 + .../OuterEnumIntegerDefaultValueTest.java | 24 + .../client/model/OuterEnumIntegerTest.java | 24 + .../client/model/OuterEnumTest.java | 23 +- .../openapitools/client/model/PetTest.java | 107 +- .../client/model/ReadOnlyFirstTest.java | 55 +- .../client/model/SpecialModelNameTest.java | 43 +- .../openapitools/client/model/TagTest.java | 55 +- .../client/model/TypeHolderDefaultTest.java | 84 - .../client/model/TypeHolderExampleTest.java | 92 -- .../openapitools/client/model/UserTest.java | 127 +- .../client/model/XmlItemTest.java | 276 ---- .../petstore/go/go-petstore/api/openapi.yaml | 3 +- .../petstore/go/go-petstore/docs/FakeApi.md | 2 +- .../php/OpenAPIClient-php/docs/Api/FakeApi.md | 7 +- .../client/petstore/python/docs/FakeApi.md | 68 +- .../python/petstore_api/api/fake_api.py | 2 +- .../petstore/ruby-faraday/docs/FakeApi.md | 5 +- .../ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../client/petstore/ruby/docs/FakeApi.md | 5 +- .../ruby/lib/petstore/api/fake_api.rb | 2 +- .../java/org/openapitools/api/FakeApi.java | 4 +- 196 files changed, 9227 insertions(+), 10030 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/ApiKeyAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/Authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBasicAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBearerAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpSignatureAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuth.mustache create mode 100644 modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuthFlow.mustache create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/DefaultApi.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/Foo.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/HealthCheckResult.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject1.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject2.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject3.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject4.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineObject5.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/InlineResponseDefault.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/NullableClass.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/OuterEnumDefaultValue.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/OuterEnumInteger.md create mode 100644 samples/client/petstore/java/jersey2-experimental/docs/OuterEnumIntegerDefaultValue.md create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/DefaultApi.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java rename samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/{AdditionalPropertiesString.java => Foo.java} (53%) create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HealthCheckResult.java rename samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/{AdditionalPropertiesAnyType.java => InlineObject.java} (59%) create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject1.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject2.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject3.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject4.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject5.java rename samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/{AdditionalPropertiesObject.java => InlineResponseDefault.java} (53%) create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NullableClass.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumInteger.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/DefaultApiTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FooTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject1Test.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject2Test.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject3Test.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject4Test.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject5Test.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObjectTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NullableClassTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java create mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java delete mode 100644 samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java diff --git a/bin/java-petstore-jersey2-experimental.sh b/bin/java-petstore-jersey2-experimental.sh index a4ab8a13a8..2bd023c97b 100755 --- a/bin/java-petstore-jersey2-experimental.sh +++ b/bin/java-petstore-jersey2-experimental.sh @@ -27,13 +27,15 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-experimental.json -o samples/client/petstore/java/jersey2-experimental -t modules/openapi-generator/src/main/resources/Java --additional-properties hideGenerationTimestamp=true $@" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -c bin/java-petstore-jersey2-experimental.json -o samples/client/petstore/java/jersey2-experimental -t modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental --additional-properties hideGenerationTimestamp=true $@" echo "Removing files and folders under samples/client/petstore/java/jersey2-experimental/src/main" rm -rf samples/client/petstore/java/jersey2-experimental/src/main find samples/client/petstore/java/jersey2-experimental -maxdepth 1 -type f ! -name "README.md" -exec rm {} + java $JAVA_OPTS -jar $executable $ags +#mvn com.coveo:fmt-maven-plugin:format -f samples/client/petstore/java/jersey2-experimental/pom.xml + # copy additional manually written unit-tests #mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client #mkdir samples/client/petstore/java/jersey2/src/test/java/org/openapitools/client/auth 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 5caf5c0b67..e708b1f7e6 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 @@ -373,6 +373,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportingFiles.add(new SupportingFile("JSON.mustache", invokerFolder, "JSON.java")); supportingFiles.add(new SupportingFile("ApiResponse.mustache", invokerFolder, "ApiResponse.java")); if (JERSEY2_EXPERIMENTAL.equals(getLibrary())) { + supportingFiles.add(new SupportingFile("auth/HttpSignatureAuth.mustache", authFolder, "HttpSignatureAuth.java")); supportingFiles.add(new SupportingFile("AbstractOpenApiSchema.mustache", (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar), "AbstractOpenApiSchema.java")); } forceSerializationLibrary(SERIALIZATION_LIBRARY_JACKSON); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache index 618264dc90..10a976f6d7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/ApiClient.mustache @@ -23,6 +23,7 @@ import org.glassfish.jersey.media.multipart.MultiPartFeature; import java.io.IOException; import java.io.InputStream; +import java.net.URI; {{^supportJava6}} import java.nio.file.Files; import java.nio.file.StandardCopyOption; @@ -56,6 +57,7 @@ import java.util.regex.Pattern; import {{invokerPackage}}.auth.Authentication; import {{invokerPackage}}.auth.HttpBasicAuth; import {{invokerPackage}}.auth.HttpBearerAuth; +import {{invokerPackage}}.auth.HttpSignatureAuth; import {{invokerPackage}}.auth.ApiKeyAuth; import {{invokerPackage}}.model.AbstractOpenApiSchema; @@ -159,11 +161,26 @@ public class ApiClient { setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} - authentications.put("{{name}}", new HttpBasicAuth());{{/isBasicBasic}}{{^isBasicBasic}} - authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}"));{{/isBasicBasic}}{{/isBasic}}{{#isApiKey}} - authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"));{{/isApiKey}}{{#isOAuth}} - authentications.put("{{name}}", new OAuth());{{/isOAuth}}{{/authMethods}} + authentications = new HashMap(); + {{#authMethods}} + {{#isBasic}} + {{#isBasicBasic}} + authentications.put("{{name}}", new HttpBasicAuth()); + {{/isBasicBasic}} + {{#isBasicBearer}} + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}")); + {{/isBasicBearer}} + {{#isHttpSignature}} + authentications.put("{{name}}", new HttpSignatureAuth("{{name}}", null, null)); + {{/isHttpSignature}} + {{/isBasic}} + {{#isApiKey}} + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}")); + {{/isApiKey}} + {{#isOAuth}} + authentications.put("{{name}}", new OAuth()); + {{/isOAuth}} + {{/authMethods}} // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -701,6 +718,38 @@ public class ApiClient { return entity; } + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + return json.getMapper().writeValueAsString(obj); + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{ Object result = null; @@ -862,7 +911,6 @@ public class ApiClient { * @throws ApiException API exception */ public ApiResponse invokeAPI(String operation, String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); // Not using `.target(targetURL).path(path)` below, // to support (constant) query string in `path`, e.g. "/posts?draft=1" @@ -935,6 +983,14 @@ public class ApiClient { Entity entity = serialize(body, formParams, contentType); + // put all headers in one place + Map allHeaderParams = new HashMap<>(); + allHeaderParams.putAll(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + // update different parameters (e.g. headers) for authentication + updateParamsForAuth(authNames, queryParams, allHeaderParams, cookieParams, serializeToString(body, formParams, contentType), method, target.getUri()); + Response response = null; try { @@ -1061,12 +1117,17 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI */ - protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache index b442f0836d..e25b307f7d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/JSON.mustache @@ -62,4 +62,6 @@ public class JSON implements ContextResolver { public ObjectMapper getContext(Class type) { return mapper; } + + public ObjectMapper getMapper() { return mapper; } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/ApiKeyAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/ApiKeyAuth.mustache new file mode 100644 index 0000000000..1731f936fb --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/ApiKeyAuth.mustache @@ -0,0 +1,68 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/Authentication.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/Authentication.mustache new file mode 100644 index 0000000000..46d9c1ab6a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/Authentication.mustache @@ -0,0 +1,22 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; + +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBasicAuth.mustache new file mode 100644 index 0000000000..898bb97ee7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBasicAuth.mustache @@ -0,0 +1,62 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +{{^java8}} +import com.migcomponents.migbase64.Base64; +{{/java8}} +{{#java8}} +import java.util.Base64; +import java.nio.charset.StandardCharsets; +{{/java8}} + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{^java8}} +import java.io.UnsupportedEncodingException; +{{/java8}} + +{{>generatedAnnotation}} +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); +{{^java8}} + try { + headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } +{{/java8}} +{{#java8}} + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); +{{/java8}} + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBearerAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBearerAuth.mustache new file mode 100644 index 0000000000..110a11ea77 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpBearerAuth.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class HttpBearerAuth implements Authentication { + private final String scheme; + private String bearerToken; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return bearerToken; + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.bearerToken = bearerToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if(bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpSignatureAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpSignatureAuth.mustache new file mode 100644 index 0000000000..3a856e3bc3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/HttpSignatureAuth.mustache @@ -0,0 +1,115 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.net.URLEncoder; +import java.security.MessageDigest; +import java.security.Key; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.List; + +import org.tomitribe.auth.signatures.*; + +public class HttpSignatureAuth implements Authentication { + + private Signer signer; + + private String name; + + private Algorithm algorithm; + + private List headers; + + public HttpSignatureAuth(String name, Algorithm algorithm, List headers) { + this.name = name; + this.algorithm = algorithm; + this.headers = headers; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Algorithm getAlgorithm() { + return algorithm; + } + + public void setAlgorithm(Algorithm algorithm) { + this.algorithm = algorithm; + } + + public List getHeaders() { + return headers; + } + + public void setHeaders(List headers) { + this.headers = headers; + } + + public Signer getSigner() { + return signer; + } + + public void setSigner(Signer signer) { + this.signer = signer; + } + + public void setup(Key key) throws ApiException { + if (key == null) { + throw new ApiException("key (java.security.Key) cannot be null"); + } + + signer = new Signer(key, new Signature(name, algorithm, null, headers)); + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, + String payload, String method, URI uri) throws ApiException { + try { + if (headers.contains("host")) { + headerParams.put("host", uri.getHost()); + } + + if (headers.contains("date")) { + headerParams.put("date", new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); + } + + if (headers.contains("digest")) { + headerParams.put("digest", "SHA-256=" + new String(Base64.getEncoder().encode(MessageDigest.getInstance("SHA-256").digest(payload.getBytes())))); + } + + if (signer == null) { + throw new ApiException("Signer cannot be null. Please run the method `setup` to set it up correctly"); + } + + // construct the path with the URL query string + String path = uri.getPath(); + + List urlQueries = new ArrayList(); + for (Pair queryParam : queryParams) { + urlQueries.add(queryParam.getName() + "=" + URLEncoder.encode(queryParam.getValue(), "utf8").replaceAll("\\+", "%20")); + } + + if (!urlQueries.isEmpty()) { + path = path + "?" + String.join("&", urlQueries); + } + + headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); + } catch (Exception ex) { + throw new ApiException("Failed to create signature in the HTTP request header: " + ex.toString()); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuth.mustache new file mode 100644 index 0000000000..8622798ad3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuth.mustache @@ -0,0 +1,30 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +import {{invokerPackage}}.Pair; +import {{invokerPackage}}.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +{{>generatedAnnotation}} +public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuthFlow.mustache new file mode 100644 index 0000000000..002e9572f3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/auth/OAuthFlow.mustache @@ -0,0 +1,7 @@ +{{>licenseInfo}} + +package {{invokerPackage}}.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache index bf1c3648c2..a71ab26386 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2-experimental/pom.mustache @@ -63,7 +63,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.0.0-M4 @@ -73,7 +73,7 @@ -Xms512m -Xmx1500m methods - pertest + 10 @@ -142,7 +142,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.1 {{#supportJava6}} 1.6 @@ -158,6 +158,13 @@ 1.7 {{/java8}} {{/supportJava6}} + true + 128m + 512m + + -Xlint:all + -J-Xss4m + @@ -283,64 +290,67 @@ ${jackson-databind-nullable-version} {{#withXml}} - - - - org.glassfish.jersey.media - jersey-media-jaxb - ${jersey-version} - - + + + org.glassfish.jersey.media + jersey-media-jaxb + ${jersey-version} + {{/withXml}} {{#joda}} - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + {{/joda}} {{#java8}} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + {{/java8}} {{#threetenbp}} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${threetenbp-version} + {{/threetenbp}} {{^java8}} - - - com.brsanthu - migbase64 - 2.2 - + + + com.brsanthu + migbase64 + 2.2 + {{/java8}} {{#supportJava6}} - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - commons-io - commons-io - ${commons_io_version} - + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + + commons-io + commons-io + ${commons-io-version} + {{/supportJava6}} + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + {{#useBeanValidation}} - - - javax.validation - validation-api - 1.1.0.Final - provided - + + + javax.validation + validation-api + 1.1.0.Final + provided + {{/useBeanValidation}} @@ -358,8 +368,8 @@ {{/supportJava6}} {{#supportJava6}} 2.6 - 2.5 - 3.6 + 2.5 + 3.6 {{/supportJava6}} 2.10.3 2.10.3 @@ -368,5 +378,6 @@ 2.9.10 {{/threetenbp}} 4.13 + 1.3 diff --git a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml index 87f547a24b..5ee649052b 100644 --- a/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1113,7 +1113,7 @@ paths: schema: type: string security: - - http_signature_test + - http_signature_test: [] requestBody: $ref: '#/components/requestBodies/Pet' responses: diff --git a/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml b/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml index 30aad25824..755ea4c030 100644 --- a/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml +++ b/samples/client/petstore/java/jersey2-experimental/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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: @@ -9,7 +9,28 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 tags: - description: Everything about your Pets name: pet @@ -18,25 +39,23 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + x-accepts: application/json /pet: post: operationId: addPet requestBody: - 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 + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,33 +64,18 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json put: operationId: updatePet requestBody: - 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 + $ref: '#/components/requestBodies/Pet' responses: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -80,9 +84,11 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -118,7 +124,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -160,7 +165,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -174,23 +178,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - 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: - "200": - content: {} - description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -205,12 +210,14 @@ paths: 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: @@ -222,10 +229,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -237,13 +242,16 @@ paths: 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: @@ -254,9 +262,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -272,13 +280,16 @@ paths: 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: @@ -290,6 +301,7 @@ paths: description: file to upload format: binary type: string + type: object responses: "200": content: @@ -331,7 +343,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -347,13 +359,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /store/order/{order_id}: delete: @@ -362,17 +372,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: order_id required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -384,6 +394,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -392,6 +403,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -403,10 +415,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -418,81 +428,65 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -506,16 +500,19 @@ paths: headers: X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when token expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -526,7 +523,6 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -538,17 +534,17 @@ paths: 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": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Delete user tags: @@ -558,11 +554,13 @@ paths: 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: @@ -574,10 +572,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -588,42 +584,36 @@ paths: 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": - content: {} description: Invalid user supplied "404": - content: {} description: User not found summary: Updated user tags: - user - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: application/json /fake_classname_test: patch: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -636,7 +626,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake: @@ -645,44 +634,60 @@ paths: operationId: testGroupParameters parameters: - description: Required String in group parameters + explode: true in: query name: required_string_group required: true schema: type: integer + style: form - description: Required Boolean in group parameters + explode: false in: header name: required_boolean_group required: true schema: type: boolean + style: simple - description: Required Integer in group parameters + explode: true in: query name: required_int64_group required: true schema: format: int64 type: integer + style: form - description: String in group parameters + explode: true in: query name: string_group + required: false schema: type: integer + style: form - description: Boolean in group parameters + explode: false in: header name: boolean_group + required: false schema: type: boolean + style: simple - description: Integer in group parameters + explode: true in: query name: int64_group + required: false schema: format: int64 type: integer + style: form responses: "400": - content: {} description: Someting wrong + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake @@ -696,6 +701,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -706,8 +712,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -715,10 +723,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -729,8 +739,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -738,25 +750,33 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: + $ref: '#/components/requestBodies/inline_object_2' content: application/x-www-form-urlencoded: schema: @@ -778,12 +798,11 @@ paths: - -efg - (xyz) type: string + type: object responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -794,12 +813,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -810,24 +824,23 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json post: - description: |- + description: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 operationId: testEndpointParameters requestBody: + $ref: '#/components/requestBodies/inline_object_3' content: application/x-www-form-urlencoded: schema: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -895,21 +908,19 @@ paths: - double - number - pattern_without_delimiter - required: true + type: object responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] - summary: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-contentType: application/x-www-form-urlencoded @@ -920,11 +931,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -934,8 +944,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/string: post: @@ -943,11 +952,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -957,8 +965,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/boolean: post: @@ -966,11 +973,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -980,8 +986,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/outer/composite: post: @@ -989,11 +994,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -1003,13 +1007,13 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-contentType: '*/*' + x-contentType: application/json x-accepts: '*/*' /fake/jsonFormData: get: operationId: testJsonFormData requestBody: + $ref: '#/components/requestBodies/inline_object_4' content: application/x-www-form-urlencoded: schema: @@ -1023,10 +1027,9 @@ paths: required: - param - param2 - required: true + type: object responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -1047,23 +1050,23 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-contentType: application/json x-accepts: application/json /fake/body-with-query-params: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1072,60 +1075,17 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-contentType: application/xml - x-accepts: application/json /another-fake/dummy: patch: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1136,7 +1096,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/body-with-file-schema: @@ -1152,11 +1111,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json /fake/test-query-paramters: @@ -1164,7 +1121,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1173,14 +1130,17 @@ paths: type: string type: array style: form - - in: query + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1208,7 +1168,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1218,13 +1177,16 @@ paths: operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_5' content: multipart/form-data: schema: @@ -1238,7 +1200,7 @@ paths: type: string required: - requiredFile - required: true + type: object responses: "200": content: @@ -1255,8 +1217,121 @@ paths: - pet x-contentType: multipart/form-data x-accepts: application/json + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: application/json + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-contentType: application/json + x-accepts: application/json components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 @@ -1421,21 +1496,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: $special[model.name] Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1455,7 +1521,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1466,7 +1531,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1474,7 +1538,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1483,10 +1546,6 @@ components: allOf: - $ref: '#/components/schemas/Animal' - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' Animal: discriminator: propertyName: className @@ -1506,13 +1565,13 @@ components: format_test: properties: integer: - maximum: 1E+2 - minimum: 1E+1 + maximum: 100 + minimum: 10 type: integer int32: format: int32 - maximum: 2E+2 - minimum: 2E+1 + maximum: 200 + minimum: 20 type: integer int64: format: int64 @@ -1536,7 +1595,6 @@ components: type: string byte: format: byte - pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$ type: string binary: format: binary @@ -1556,8 +1614,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i type: string required: - byte @@ -1600,117 +1664,27 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: additionalProperties: type: string type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: + map_of_map_property: additionalProperties: additionalProperties: type: string type: object type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string type: object MixedPropertiesAndAdditionalPropertiesClass: properties: @@ -1856,7 +1830,28 @@ components: - placed - approved - delivered + nullable: true type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1906,243 +1901,223 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object xml: - namespace: http://a.com/schema - prefix: pre + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object Dog_allOf: properties: breed: @@ -2151,15 +2126,6 @@ components: properties: declawed: type: boolean - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string securitySchemes: petstore_auth: flows: @@ -2180,4 +2146,11 @@ components: http_basic_test: scheme: basic type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md index 36e1816200..0d9dbd055b 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/AdditionalPropertiesClass.md @@ -6,17 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**mapString** | **Map<String, String>** | | [optional] -**mapNumber** | [**Map<String, BigDecimal>**](BigDecimal.md) | | [optional] -**mapInteger** | **Map<String, Integer>** | | [optional] -**mapBoolean** | **Map<String, Boolean>** | | [optional] -**mapArrayInteger** | [**Map<String, List<Integer>>**](List.md) | | [optional] -**mapArrayAnytype** | [**Map<String, List<Object>>**](List.md) | | [optional] -**mapMapString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapMapAnytype** | [**Map<String, Map<String, Object>>**](Map.md) | | [optional] -**anytype1** | [**Object**](.md) | | [optional] -**anytype2** | [**Object**](.md) | | [optional] -**anytype3** | [**Object**](.md) | | [optional] +**mapProperty** | **Map<String, String>** | | [optional] +**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md index 059616ec6b..6740d5770d 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/AnotherFakeApi.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## call123testSpecialTags -> Client call123testSpecialTags(body) +> Client call123testSpecialTags(client) To test special tags @@ -32,9 +32,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); AnotherFakeApi apiInstance = new AnotherFakeApi(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.call123testSpecialTags(body); + Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); @@ -52,7 +52,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2-experimental/docs/DefaultApi.md b/samples/client/petstore/java/jersey2-experimental/docs/DefaultApi.md new file mode 100644 index 0000000000..afb01fb829 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/DefaultApi.md @@ -0,0 +1,68 @@ +# DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | + + + +## fooGet + +> InlineResponseDefault fooGet() + + + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.models.*; +import org.openapitools.client.api.DefaultApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + DefaultApi apiInstance = new DefaultApi(defaultClient); + try { + InlineResponseDefault result = apiInstance.fooGet(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#fooGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](InlineResponseDefault.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **0** | response | - | + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md b/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md index 61eb95f22f..1692bd664d 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/EnumTest.md @@ -11,6 +11,9 @@ Name | Type | Description | Notes **enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] **enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] +**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md b/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md index 543c51f066..ec63327355 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/FakeApi.md @@ -4,7 +4,8 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createXmlItem**](FakeApi.md#createXmlItem) | **POST** /fake/create_xml_item | creates an XmlItem +[**fakeHealthGet**](FakeApi.md#fakeHealthGet) | **GET** /fake/health | Health check endpoint +[**fakeHttpSignatureTest**](FakeApi.md#fakeHttpSignatureTest) | **GET** /fake/http-signature-test | test http signature authentication [**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | [**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | @@ -12,7 +13,7 @@ Method | HTTP request | Description [**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 [**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters [**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) [**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties @@ -21,13 +22,11 @@ Method | HTTP request | Description -## createXmlItem +## fakeHealthGet -> createXmlItem(xmlItem) +> HealthCheckResult fakeHealthGet() -creates an XmlItem - -this route creates an XmlItem +Health check endpoint ### Example @@ -45,11 +44,74 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - XmlItem xmlItem = new XmlItem(); // XmlItem | XmlItem Body try { - apiInstance.createXmlItem(xmlItem); + HealthCheckResult result = apiInstance.fakeHealthGet(); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#createXmlItem"); + System.err.println("Exception when calling FakeApi#fakeHealthGet"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | The instance started successfully | - | + + +## fakeHttpSignatureTest + +> fakeHttpSignatureTest(pet, query1, header1) + +test http signature authentication + +### Example + +```java +// Import classes: +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; +import org.openapitools.client.models.*; +import org.openapitools.client.api.FakeApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + + FakeApi apiInstance = new FakeApi(defaultClient); + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + String query1 = "query1_example"; // String | query parameter + String header1 = "header1_example"; // String | header parameter + try { + apiInstance.fakeHttpSignatureTest(pet, query1, header1); + } catch (ApiException e) { + System.err.println("Exception when calling FakeApi#fakeHttpSignatureTest"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); @@ -64,7 +126,9 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **xmlItem** | [**XmlItem**](XmlItem.md)| XmlItem Body | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **query1** | **String**| query parameter | [optional] + **header1** | **String**| header parameter | [optional] ### Return type @@ -72,17 +136,17 @@ null (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers -- **Content-Type**: application/xml, application/xml; charset=utf-8, application/xml; charset=utf-16, text/xml, text/xml; charset=utf-8, text/xml; charset=utf-16 +- **Content-Type**: application/json, application/xml - **Accept**: Not defined ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | +| **200** | The instance started successfully | - | ## fakeOuterBooleanSerialize @@ -141,7 +205,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -152,7 +216,7 @@ No authorization required ## fakeOuterCompositeSerialize -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outerComposite) @@ -174,9 +238,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + OuterComposite outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); + OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); @@ -194,7 +258,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] ### Return type @@ -206,7 +270,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -271,7 +335,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -336,7 +400,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: */* ### HTTP response details @@ -347,7 +411,7 @@ No authorization required ## testBodyWithFileSchema -> testBodyWithFileSchema(body) +> testBodyWithFileSchema(fileSchemaTestClass) @@ -369,9 +433,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - FileSchemaTestClass body = new FileSchemaTestClass(); // FileSchemaTestClass | + FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | try { - apiInstance.testBodyWithFileSchema(body); + apiInstance.testBodyWithFileSchema(fileSchemaTestClass); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); System.err.println("Status code: " + e.getCode()); @@ -388,7 +452,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | ### Return type @@ -411,7 +475,7 @@ No authorization required ## testBodyWithQueryParams -> testBodyWithQueryParams(query, body) +> testBodyWithQueryParams(query, user) @@ -432,9 +496,9 @@ public class Example { FakeApi apiInstance = new FakeApi(defaultClient); String query = "query_example"; // String | - User body = new User(); // User | + User user = new User(); // User | try { - apiInstance.testBodyWithQueryParams(query, body); + apiInstance.testBodyWithQueryParams(query, user); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); System.err.println("Status code: " + e.getCode()); @@ -452,7 +516,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **String**| | - **body** | [**User**](User.md)| | + **user** | [**User**](User.md)| | ### Return type @@ -475,7 +539,7 @@ No authorization required ## testClientModel -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -497,9 +561,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClientModel(body); + Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testClientModel"); @@ -517,7 +581,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type @@ -542,12 +606,13 @@ No authorization required > testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 +假端點 +偽のエンドポイント +가짜 엔드 포인트 + ### Example @@ -732,6 +797,7 @@ Fake endpoint to test group parameters (optional) import org.openapitools.client.ApiClient; import org.openapitools.client.ApiException; import org.openapitools.client.Configuration; +import org.openapitools.client.auth.*; import org.openapitools.client.models.*; import org.openapitools.client.api.FakeApi; @@ -739,6 +805,10 @@ public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); + + // Configure HTTP bearer authorization: bearer_test + HttpBearerAuth bearer_test = (HttpBearerAuth) defaultClient.getAuthentication("bearer_test"); + bearer_test.setBearerToken("BEARER TOKEN"); FakeApi apiInstance = new FakeApi(defaultClient); Integer requiredStringGroup = 56; // Integer | Required String in group parameters @@ -785,7 +855,7 @@ null (empty response body) ### Authorization -No authorization required +[bearer_test](../README.md#bearer_test) ### HTTP request headers @@ -800,7 +870,7 @@ No authorization required ## testInlineAdditionalProperties -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(requestBody) test inline additionalProperties @@ -820,9 +890,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); FakeApi apiInstance = new FakeApi(defaultClient); - Map param = new HashMap(); // Map | request body + Map requestBody = new HashMap(); // Map | request body try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); System.err.println("Status code: " + e.getCode()); @@ -839,7 +909,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | [**Map<String, String>**](String.md)| request body | + **requestBody** | [**Map<String, String>**](String.md)| request body | ### Return type diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md index 14a74a37a4..db98afa721 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/FakeClassnameTags123Api.md @@ -10,7 +10,7 @@ Method | HTTP request | Description ## testClassname -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case @@ -39,9 +39,9 @@ public class Example { //api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(defaultClient); - Client body = new Client(); // Client | client model + Client client = new Client(); // Client | client model try { - Client result = apiInstance.testClassname(body); + Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); @@ -59,7 +59,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](Client.md)| client model | ### Return type diff --git a/samples/client/petstore/java/jersey2-experimental/docs/Foo.md b/samples/client/petstore/java/jersey2-experimental/docs/Foo.md new file mode 100644 index 0000000000..02c7ef53f5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/Foo.md @@ -0,0 +1,12 @@ + + +# Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md b/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md index d138e92190..742bccb77e 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/FormatTest.md @@ -19,7 +19,8 @@ Name | Type | Description | Notes **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] **password** | **String** | | -**bigDecimal** | [**BigDecimal**](BigDecimal.md) | | [optional] +**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] diff --git a/samples/client/petstore/java/jersey2-experimental/docs/HealthCheckResult.md b/samples/client/petstore/java/jersey2-experimental/docs/HealthCheckResult.md new file mode 100644 index 0000000000..11bb9026e4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/HealthCheckResult.md @@ -0,0 +1,13 @@ + + +# HealthCheckResult + +Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**nullableMessage** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject.md new file mode 100644 index 0000000000..999fe3ef00 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject.md @@ -0,0 +1,13 @@ + + +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Updated name of the pet | [optional] +**status** | **String** | Updated status of the pet | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject1.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject1.md new file mode 100644 index 0000000000..b3828dfae4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject1.md @@ -0,0 +1,13 @@ + + +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**file** | [**File**](File.md) | file to upload | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject2.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject2.md new file mode 100644 index 0000000000..7e4ed7591c --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject2.md @@ -0,0 +1,32 @@ + + +# InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enumFormStringArray** | [**List<EnumFormStringArrayEnum>**](#List<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional] +**enumFormString** | [**EnumFormStringEnum**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional] + + + +## Enum: List<EnumFormStringArrayEnum> + +Name | Value +---- | ----- +GREATER_THAN | ">" +DOLLAR | "$" + + + +## Enum: EnumFormStringEnum + +Name | Value +---- | ----- +_ABC | "_abc" +_EFG | "-efg" +_XYZ_ | "(xyz)" + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject3.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject3.md new file mode 100644 index 0000000000..c1ebfe2578 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject3.md @@ -0,0 +1,25 @@ + + +# InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integer** | **Integer** | None | [optional] +**int32** | **Integer** | None | [optional] +**int64** | **Long** | None | [optional] +**number** | [**BigDecimal**](BigDecimal.md) | None | +**_float** | **Float** | None | [optional] +**_double** | **Double** | None | +**string** | **String** | None | [optional] +**patternWithoutDelimiter** | **String** | None | +**_byte** | **byte[]** | None | +**binary** | [**File**](File.md) | None | [optional] +**date** | [**LocalDate**](LocalDate.md) | None | [optional] +**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | None | [optional] +**password** | **String** | None | [optional] +**callback** | **String** | None | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject4.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject4.md new file mode 100644 index 0000000000..5ebef87240 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject4.md @@ -0,0 +1,13 @@ + + +# InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**param** | **String** | field1 | +**param2** | **String** | field2 | + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineObject5.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject5.md new file mode 100644 index 0000000000..42d2673574 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineObject5.md @@ -0,0 +1,13 @@ + + +# InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **String** | Additional data to pass to server | [optional] +**requiredFile** | [**File**](File.md) | file to upload | + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/InlineResponseDefault.md b/samples/client/petstore/java/jersey2-experimental/docs/InlineResponseDefault.md new file mode 100644 index 0000000000..63c30c2b73 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/InlineResponseDefault.md @@ -0,0 +1,12 @@ + + +# InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | [**Foo**](Foo.md) | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/NullableClass.md b/samples/client/petstore/java/jersey2-experimental/docs/NullableClass.md new file mode 100644 index 0000000000..7567ec0c05 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/NullableClass.md @@ -0,0 +1,23 @@ + + +# NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**integerProp** | **Integer** | | [optional] +**numberProp** | [**BigDecimal**](BigDecimal.md) | | [optional] +**booleanProp** | **Boolean** | | [optional] +**stringProp** | **String** | | [optional] +**dateProp** | [**LocalDate**](LocalDate.md) | | [optional] +**datetimeProp** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] +**arrayNullableProp** | **List<Object>** | | [optional] +**arrayAndItemsNullableProp** | **List<Object>** | | [optional] +**arrayItemsNullable** | **List<Object>** | | [optional] +**objectNullableProp** | **Map<String, Object>** | | [optional] +**objectAndItemsNullableProp** | **Map<String, Object>** | | [optional] +**objectItemsNullable** | **Map<String, Object>** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumDefaultValue.md b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumDefaultValue.md new file mode 100644 index 0000000000..cbc7f4ba54 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumDefaultValue + +## Enum + + +* `PLACED` (value: `"placed"`) + +* `APPROVED` (value: `"approved"`) + +* `DELIVERED` (value: `"delivered"`) + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumInteger.md b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumInteger.md new file mode 100644 index 0000000000..f71dea30ad --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumInteger.md @@ -0,0 +1,15 @@ + + +# OuterEnumInteger + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 0000000000..99e6389f42 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,15 @@ + + +# OuterEnumIntegerDefaultValue + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + + + diff --git a/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md b/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md index 875a8e6783..0c3b8e70e3 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/PetApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description ## addPet -> addPet(body) +> addPet(pet) Add a new pet to the store @@ -43,9 +43,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(body); + apiInstance.addPet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); System.err.println("Status code: " + e.getCode()); @@ -62,7 +62,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -80,7 +80,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | | **405** | Invalid input | - | @@ -150,7 +149,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | | **400** | Invalid pet value | - | @@ -372,7 +370,7 @@ Name | Type | Description | Notes ## updatePet -> updatePet(body) +> updatePet(pet) Update an existing pet @@ -397,9 +395,9 @@ public class Example { petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(defaultClient); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(body); + apiInstance.updatePet(pet); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); System.err.println("Status code: " + e.getCode()); @@ -416,7 +414,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -434,7 +432,6 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -| **200** | successful operation | - | | **400** | Invalid ID supplied | - | | **404** | Pet not found | - | | **405** | Validation exception | - | diff --git a/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md b/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md index 6625d5969e..5d2d7ad511 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/StoreApi.md @@ -213,7 +213,7 @@ No authorization required ## placeOrder -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet @@ -233,9 +233,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); StoreApi apiInstance = new StoreApi(defaultClient); - Order body = new Order(); // Order | order placed for purchasing the pet + Order order = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(body); + Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -253,7 +253,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -265,7 +265,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/xml, application/json ### HTTP response details diff --git a/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md b/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md index ca9f550c31..d7e613c24a 100644 --- a/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-experimental/docs/UserApi.md @@ -17,7 +17,7 @@ Method | HTTP request | Description ## createUser -> createUser(body) +> createUser(user) Create user @@ -39,9 +39,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - User body = new User(); // User | Created user object + User user = new User(); // User | Created user object try { - apiInstance.createUser(body); + apiInstance.createUser(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); System.err.println("Status code: " + e.getCode()); @@ -58,7 +58,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -70,7 +70,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -81,7 +81,7 @@ No authorization required ## createUsersWithArrayInput -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array @@ -101,9 +101,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - apiInstance.createUsersWithArrayInput(body); + apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); System.err.println("Status code: " + e.getCode()); @@ -120,7 +120,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -132,7 +132,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -143,7 +143,7 @@ No authorization required ## createUsersWithListInput -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array @@ -163,9 +163,9 @@ public class Example { defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); UserApi apiInstance = new UserApi(defaultClient); - List body = Arrays.asList(); // List | List of user object + List user = Arrays.asList(); // List | List of user object try { - apiInstance.createUsersWithListInput(body); + apiInstance.createUsersWithListInput(user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); System.err.println("Status code: " + e.getCode()); @@ -182,7 +182,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](User.md)| List of user object | ### Return type @@ -194,7 +194,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details @@ -459,7 +459,7 @@ No authorization required ## updateUser -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -482,9 +482,9 @@ public class Example { UserApi apiInstance = new UserApi(defaultClient); String username = "username_example"; // String | name that need to be deleted - User body = new User(); // User | Updated user object + User user = new User(); // User | Updated user object try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(username, user); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); System.err.println("Status code: " + e.getCode()); @@ -502,7 +502,7 @@ public class Example { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -514,7 +514,7 @@ No authorization required ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: Not defined ### HTTP response details diff --git a/samples/client/petstore/java/jersey2-experimental/pom.xml b/samples/client/petstore/java/jersey2-experimental/pom.xml index 3affc56f00..84d5d5ce18 100644 --- a/samples/client/petstore/java/jersey2-experimental/pom.xml +++ b/samples/client/petstore/java/jersey2-experimental/pom.xml @@ -56,7 +56,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12 + 3.0.0-M4 @@ -66,7 +66,7 @@ -Xms512m -Xmx1500m methods - pertest + 10 @@ -135,10 +135,17 @@ org.apache.maven.plugins maven-compiler-plugin - 3.6.1 + 3.8.1 1.7 1.7 + true + 128m + 512m + + -Xlint:all + -J-Xss4m + @@ -261,17 +268,22 @@ jackson-databind-nullable ${jackson-databind-nullable-version} - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - - - - com.brsanthu - migbase64 - 2.2 - + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${threetenbp-version} + + + + com.brsanthu + migbase64 + 2.2 + + + org.tomitribe + tomitribe-http-signatures + ${http-signature-version} + junit @@ -289,5 +301,6 @@ 0.2.1 2.9.10 4.13 + 1.3 diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java index 30609a4a8e..fdbba2916e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiClient.java @@ -1,5 +1,26 @@ package org.openapitools.client; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URI; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.text.DateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.Entity; @@ -10,69 +31,97 @@ import javax.ws.rs.core.GenericType; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; - import org.glassfish.jersey.client.ClientConfig; import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; import org.glassfish.jersey.media.multipart.MultiPartFeature; - -import java.io.IOException; -import java.io.InputStream; - -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import org.glassfish.jersey.logging.LoggingFeature; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Map.Entry; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Date; -import java.util.TimeZone; - -import java.net.URLEncoder; - -import java.io.File; -import java.io.UnsupportedEncodingException; - -import java.text.DateFormat; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - +import org.openapitools.client.auth.ApiKeyAuth; import org.openapitools.client.auth.Authentication; import org.openapitools.client.auth.HttpBasicAuth; import org.openapitools.client.auth.HttpBearerAuth; -import org.openapitools.client.auth.ApiKeyAuth; -import org.openapitools.client.model.AbstractOpenApiSchema; - +import org.openapitools.client.auth.HttpSignatureAuth; import org.openapitools.client.auth.OAuth; - +import org.openapitools.client.model.AbstractOpenApiSchema; public class ApiClient { protected Map defaultHeaderMap = new HashMap(); protected Map defaultCookieMap = new HashMap(); protected String basePath = "http://petstore.swagger.io:80/v2"; - protected List servers = new ArrayList(Arrays.asList( - new ServerConfiguration( - "http://petstore.swagger.io:80/v2", - "No description provided", - new HashMap() - ) - )); + protected List servers = + new ArrayList( + Arrays.asList( + new ServerConfiguration( + "http://{server}.swagger.io:{port}/v2", + "petstore server", + new HashMap() { + { + put( + "server", + new ServerVariable( + "No description provided", + "petstore", + new HashSet( + Arrays.asList("petstore", "qa-petstore", "dev-petstore")))); + put( + "port", + new ServerVariable( + "No description provided", + "80", + new HashSet(Arrays.asList("80", "8080")))); + } + }), + new ServerConfiguration( + "https://localhost:8080/{version}", + "The local server", + new HashMap() { + { + put( + "version", + new ServerVariable( + "No description provided", + "v2", + new HashSet(Arrays.asList("v1", "v2")))); + } + }))); protected Integer serverIndex = 0; protected Map serverVariables = null; - protected Map> operationServers = new HashMap>() {{ - }}; + protected Map> operationServers = + new HashMap>() { + { + put( + "PetApi.addPet", + new ArrayList( + Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new HashMap()), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new HashMap())))); + put( + "PetApi.updatePet", + new ArrayList( + Arrays.asList( + new ServerConfiguration( + "http://petstore.swagger.io/v2", + "No description provided", + new HashMap()), + new ServerConfiguration( + "http://path-server-test.petstore.local/v2", + "No description provided", + new HashMap())))); + } + }; protected Map operationServerIndex = new HashMap(); - protected Map> operationServerVariables = new HashMap>(); + protected Map> operationServerVariables = + new HashMap>(); protected boolean debugging = false; protected int connectionTimeout = 0; private int readTimeout = 0; @@ -99,7 +148,10 @@ public class ApiClient { authentications = new HashMap(); authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("bearer_test", new HttpBearerAuth("bearer")); authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put( + "http_signature_test", new HttpSignatureAuth("http_signature_test", null, null)); authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); @@ -110,6 +162,7 @@ public class ApiClient { /** * Gets the JSON instance to do JSON serialization and deserialization. + * * @return JSON */ public JSON getJSON() { @@ -163,6 +216,7 @@ public class ApiClient { /** * Get authentications (key: authentication name, value: authentication). + * * @return Map of authentication object */ public Map getAuthentications() { @@ -181,6 +235,7 @@ public class ApiClient { /** * Helper method to set username for the first HTTP basic authentication. + * * @param username Username */ public void setUsername(String username) { @@ -195,6 +250,7 @@ public class ApiClient { /** * Helper method to set password for the first HTTP basic authentication. + * * @param password Password */ public void setPassword(String password) { @@ -209,6 +265,7 @@ public class ApiClient { /** * Helper method to set API key value for the first API key authentication. + * * @param apiKey API key */ public void setApiKey(String apiKey) { @@ -242,6 +299,7 @@ public class ApiClient { /** * Helper method to set API key prefix for the first API key authentication. + * * @param apiKeyPrefix API key prefix */ public void setApiKeyPrefix(String apiKeyPrefix) { @@ -256,6 +314,7 @@ public class ApiClient { /** * Helper method to set bearer token for the first Bearer authentication. + * * @param bearerToken Bearer token */ public void setBearerToken(String bearerToken) { @@ -270,6 +329,7 @@ public class ApiClient { /** * Helper method to set access token for the first OAuth2 authentication. + * * @param accessToken Access token */ public void setAccessToken(String accessToken) { @@ -284,6 +344,7 @@ public class ApiClient { /** * Set the User-Agent header's value (by adding to the default header map). + * * @param userAgent Http user agent * @return API client */ @@ -318,6 +379,7 @@ public class ApiClient { /** * Check that whether debugging is enabled for this API client. + * * @return True if debugging is switched on */ public boolean isDebugging() { @@ -338,9 +400,8 @@ public class ApiClient { } /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default tempopary folder. + * The path of temporary folder used to store downloaded files from endpoints with file response. + * The default value is null, i.e. using the system's default tempopary folder. * * @return Temp folder path */ @@ -350,6 +411,7 @@ public class ApiClient { /** * Set temp folder path + * * @param tempFolderPath Temp folder path * @return API client */ @@ -360,6 +422,7 @@ public class ApiClient { /** * Connect timeout (in milliseconds). + * * @return Connection timeout */ public int getConnectTimeout() { @@ -367,9 +430,9 @@ public class ApiClient { } /** - * Set the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. + * Set the connect timeout (in milliseconds). A value of 0 means no timeout, otherwise values must + * be between 1 and {@link Integer#MAX_VALUE}. + * * @param connectionTimeout Connection timeout in milliseconds * @return API client */ @@ -381,6 +444,7 @@ public class ApiClient { /** * read timeout (in milliseconds). + * * @return Read timeout */ public int getReadTimeout() { @@ -388,9 +452,9 @@ public class ApiClient { } /** - * Set the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. + * Set the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be + * between 1 and {@link Integer#MAX_VALUE}. + * * @param readTimeout Read timeout in milliseconds * @return API client */ @@ -402,6 +466,7 @@ public class ApiClient { /** * Get the date format used to parse/format date parameters. + * * @return Date format */ public DateFormat getDateFormat() { @@ -410,6 +475,7 @@ public class ApiClient { /** * Set the date format used to parse/format date parameters. + * * @param dateFormat Date format * @return API client */ @@ -422,6 +488,7 @@ public class ApiClient { /** * Parse the given string into Date object. + * * @param str String * @return Date */ @@ -435,6 +502,7 @@ public class ApiClient { /** * Format the given Date object into string. + * * @param date Date * @return Date in string format */ @@ -444,6 +512,7 @@ public class ApiClient { /** * Format the given parameter object into string. + * * @param param Object * @return Object in string format */ @@ -454,8 +523,8 @@ public class ApiClient { return formatDate((Date) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { + for (Object o : (Collection) param) { + if (b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); @@ -473,7 +542,7 @@ public class ApiClient { * @param value Value * @return List of pairs */ - public List parameterToPairs(String collectionFormat, String name, Object value){ + public List parameterToPairs(String collectionFormat, String name, Object value) { List params = new ArrayList(); // preconditions @@ -487,12 +556,13 @@ public class ApiClient { return params; } - if (valueCollection.isEmpty()){ + if (valueCollection.isEmpty()) { return params; } // get the collection format (default: csv) - String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + String format = + (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { @@ -515,7 +585,7 @@ public class ApiClient { delimiter = "|"; } - StringBuilder sb = new StringBuilder() ; + StringBuilder sb = new StringBuilder(); for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); @@ -527,13 +597,9 @@ public class ApiClient { } /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON + * Check if the given MIME is a JSON MIME. JSON MIME examples: application/json application/json; + * charset=UTF8 APPLICATION/JSON application/vnd.company+json "* / *" is also default to JSON + * * @param mime MIME * @return True if the MIME type is JSON */ @@ -543,13 +609,12 @@ public class ApiClient { } /** - * 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) + * Select the Accept header's value from the given accepts array: if JSON exists in the given + * array, use it; otherwise use all of them (joining into a string) * * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). + * @return The Accept header to use. If the given array is empty, null will be returned (not to + * set the Accept header explicitly). */ public String selectHeaderAccept(String[] accepts) { if (accepts.length == 0) { @@ -564,13 +629,11 @@ public class ApiClient { } /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. + * Select the Content-Type header's value from the given array: if JSON exists in the given array, + * use it; otherwise use the first one of the array. * * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. + * @return The Content-Type header to use. If the given array is empty, JSON will be used. */ public String selectHeaderContentType(String[] contentTypes) { if (contentTypes.length == 0) { @@ -586,6 +649,7 @@ public class ApiClient { /** * Escape the given string to be used as URL query value. + * * @param str String * @return Escaped string */ @@ -598,33 +662,41 @@ public class ApiClient { } /** - * Serialize the given Java object into string entity according the given - * Content-Type (only JSON is supported for now). + * Serialize the given Java object into string entity according the given Content-Type (only JSON + * is supported for now). + * * @param obj Object * @param formParams Form parameters * @param contentType Context type * @return Entity * @throws ApiException API exception */ - public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { + public Entity serialize(Object obj, Map formParams, String contentType) + throws ApiException { Entity entity; if (contentType.startsWith("multipart/form-data")) { MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { + for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof File) { File file = (File) param.getValue(); - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) - .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); + FormDataContentDisposition contentDisp = + FormDataContentDisposition.name(param.getKey()) + .fileName(file.getName()) + .size(file.length()) + .build(); + multiPart.bodyPart( + new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); } else { - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); + FormDataContentDisposition contentDisp = + FormDataContentDisposition.name(param.getKey()).build(); + multiPart.bodyPart( + new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); } } entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { Form form = new Form(); - for (Entry param: formParams.entrySet()) { + for (Entry param : formParams.entrySet()) { form.param(param.getKey(), parameterToString(param.getValue())); } entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); @@ -635,7 +707,47 @@ public class ApiClient { return entity; } - public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) throws ApiException{ + /** + * Serialize the given Java object into string according the given Content-Type (only JSON, HTTP + * form is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType) + throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException( + "multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = + param.getKey() + + "=" + + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + return json.getMapper().writeValueAsString(obj); + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + + public AbstractOpenApiSchema deserializeSchemas(Response response, AbstractOpenApiSchema schema) + throws ApiException { Object result = null; int matchCounter = 0; @@ -657,35 +769,44 @@ public class ApiClient { } else if ("oneOf".equals(schema.getSchemaType())) { matchSchemas.add(schemaName); } else { - throw new ApiException("Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType()); + throw new ApiException( + "Unknowe type found while expecting anyOf/oneOf:" + schema.getSchemaType()); } } else { - // failed to deserialize the response in the schema provided, proceed to the next one if any + // failed to deserialize the response in the schema provided, proceed to the next one if + // any } } catch (Exception ex) { // failed to deserialize, do nothing and try next one (schema) } - } else {// unknown type - throw new ApiException(schemaType.getClass() + " is not a GenericType and cannot be handled properly in deserialization."); + } else { // unknown type + throw new ApiException( + schemaType.getClass() + + " is not a GenericType and cannot be handled properly in deserialization."); } - } - if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) {// more than 1 match for oneOf - throw new ApiException("Response body is invalid as it matches more than one schema (" + String.join(", ", matchSchemas) + ") defined in the oneOf model: " + schema.getClass().getName()); + if (matchCounter > 1 && "oneOf".equals(schema.getSchemaType())) { // more than 1 match for oneOf + throw new ApiException( + "Response body is invalid as it matches more than one schema (" + + String.join(", ", matchSchemas) + + ") defined in the oneOf model: " + + schema.getClass().getName()); } else if (matchCounter == 0) { // fail to match any in oneOf/anyOf schemas - throw new ApiException("Response body is invalid as it doens't match any schemas (" + String.join(", ", schema.getSchemas().keySet()) + ") defined in the oneOf/anyOf model: " + schema.getClass().getName()); + throw new ApiException( + "Response body is invalid as it doens't match any schemas (" + + String.join(", ", schema.getSchemas().keySet()) + + ") defined in the oneOf/anyOf model: " + + schema.getClass().getName()); } else { // only one matched schema.setActualInstance(result); return schema; } - } - - /** * Deserialize response body to Java object according to the Content-Type. + * * @param Type * @param response Response * @param returnType Return type @@ -720,6 +841,7 @@ public class ApiClient { /** * Download file from the given response. + * * @param response Response * @return File * @throws ApiException If fail to read file content from response and write to disk @@ -727,7 +849,10 @@ public class ApiClient { public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); - Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + Files.copy( + response.readEntity(InputStream.class), + file.toPath(), + StandardCopyOption.REPLACE_EXISTING); return file; } catch (IOException e) { throw new ApiException(e); @@ -741,8 +866,7 @@ public class ApiClient { // Get filename from the Content-Disposition header. Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); + if (matcher.find()) filename = matcher.group(1); } String prefix; @@ -759,14 +883,11 @@ public class ApiClient { suffix = filename.substring(pos); } // File.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; + if (prefix.length() < 3) prefix = "download-"; } - if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); - else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + if (tempFolderPath == null) return File.createTempFile(prefix, suffix); + else return File.createTempFile(prefix, suffix, new File(tempFolderPath)); } /** @@ -789,8 +910,21 @@ public class ApiClient { * @return The response body in type of string * @throws ApiException API exception */ - public ApiResponse invokeAPI(String operation, String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams, cookieParams); + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + AbstractOpenApiSchema schema) + throws ApiException { // Not using `.target(targetURL).path(path)` below, // to support (constant) query string in `path`, e.g. "/posts?draft=1" @@ -810,9 +944,10 @@ public class ApiClient { serverConfigurations = servers; } if (index < 0 || index >= serverConfigurations.size()) { - throw new ArrayIndexOutOfBoundsException(String.format( - "Invalid index %d when selecting the host settings. Must be less than %d", index, serverConfigurations.size() - )); + throw new ArrayIndexOutOfBoundsException( + String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); } targetURL = serverConfigurations.get(index).URL(variables) + path; } else { @@ -863,6 +998,21 @@ public class ApiClient { Entity entity = serialize(body, formParams, contentType); + // put all headers in one place + Map allHeaderParams = new HashMap<>(); + allHeaderParams.putAll(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + serializeToString(body, formParams, contentType), + method, + target.getUri()); + Response response = null; try { @@ -892,14 +1042,13 @@ public class ApiClient { if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { return new ApiResponse<>(statusCode, responseHeaders); } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { - if (returnType == null) - return new ApiResponse<>(statusCode, responseHeaders); - else - if (schema == null) { - return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType)); - } else { // oneOf/anyOf - return new ApiResponse<>(statusCode, responseHeaders, (T)deserializeSchemas(response, schema)); - } + if (returnType == null) return new ApiResponse<>(statusCode, responseHeaders); + else if (schema == null) { + return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType)); + } else { // oneOf/anyOf + return new ApiResponse<>( + statusCode, responseHeaders, (T) deserializeSchemas(response, schema)); + } } else { String message = "error"; String respBody = null; @@ -912,30 +1061,53 @@ public class ApiClient { } } throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); + response.getStatus(), message, buildResponseHeaders(response), respBody); } } finally { try { response.close(); } catch (Exception e) { - // it's not critical, since the response object is local in method invokeAPI; that's fine, just continue + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue } } } - /** - * @deprecated Add qualified name of the operation as a first parameter. - */ + /** @deprecated Add qualified name of the operation as a first parameter. */ @Deprecated - public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, AbstractOpenApiSchema schema) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, schema); + public ApiResponse invokeAPI( + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + AbstractOpenApiSchema schema) + throws ApiException { + return invokeAPI( + null, + path, + method, + queryParams, + body, + headerParams, + cookieParams, + formParams, + accept, + contentType, + authNames, + returnType, + schema); } /** * Build the Client used to make HTTP requests. + * * @param debugging Debug setting * @return Client */ @@ -948,13 +1120,21 @@ public class ApiClient { // turn off compliance validation to be able to send payloads with DELETE calls clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); if (debugging) { - clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); - clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + clientConfig.register( + new LoggingFeature( + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), + java.util.logging.Level.INFO, + LoggingFeature.Verbosity.PAYLOAD_ANY, + 1024 * 50 /* Log payloads up to 50K */)); + clientConfig.property( + LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL - java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME) + .setLevel(java.util.logging.Level.ALL); } else { // suppress warnings for payloads with DELETE calls: - java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + java.util.logging.Logger.getLogger("org.glassfish.jersey.client") + .setLevel(java.util.logging.Level.SEVERE); } performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); @@ -966,7 +1146,7 @@ public class ApiClient { protected Map> buildResponseHeaders(Response response) { Map> responseHeaders = new HashMap>(); - for (Entry> entry: response.getHeaders().entrySet()) { + for (Entry> entry : response.getHeaders().entrySet()) { List values = entry.getValue(); List headers = new ArrayList(); for (Object o : values) { @@ -984,12 +1164,24 @@ public class ApiClient { * @param queryParams List of query parameters * @param headerParams Map of header parameters * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI */ - protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, Map cookieParams) { + protected void updateParamsForAuth( + String[] authNames, + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams, cookieParams); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java index 6c91e35f27..5bdd88d576 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiException.java @@ -3,89 +3,95 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; -import java.util.Map; import java.util.List; - +import java.util.Map; public class ApiException extends Exception { - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; - public ApiException() {} + public ApiException() {} - public ApiException(Throwable throwable) { - super(throwable); - } + public ApiException(Throwable throwable) { + super(throwable); + } - public ApiException(String message) { - super(message); - } + public ApiException(String message) { + super(message); + } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders, + String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } + public ApiException( + String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } + public ApiException( + String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } - public ApiException(int code, String message) { - super(message); - this.code = code; - } + public ApiException(int code, String message) { + super(message); + this.code = code; + } - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } + public ApiException( + int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java index 4a3226d1db..fd4a259e36 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ApiResponse.java @@ -3,14 +3,13 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; import java.util.List; @@ -22,38 +21,38 @@ import java.util.Map; * @param The type of data that is deserialized from response body */ public class ApiResponse { - private final int statusCode; - private final Map> headers; - private final T data; + private final int statusCode; + private final Map> headers; + private final T data; - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } - public int getStatusCode() { - return statusCode; - } + public int getStatusCode() { + return statusCode; + } - public Map> getHeaders() { - return headers; - } + public Map> getHeaders() { + return headers; + } - public T getData() { - return data; - } + public T getData() { + return data; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java index acbecda489..107ad039b0 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Configuration.java @@ -3,37 +3,35 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; - public class Configuration { - private static ApiClient defaultApiClient = new ApiClient(); + private static ApiClient defaultApiClient = new ApiClient(); - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } + /** + * Get the default API client, which would be used when creating API instances without providing + * an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } + /** + * Set the default API client, which would be used when creating API instances without providing + * an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java index 83d4514b07..12541a8636 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/CustomInstantDeserializer.java @@ -9,6 +9,8 @@ import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; import com.fasterxml.jackson.datatype.threetenbp.function.Function; +import java.io.IOException; +import java.math.BigDecimal; import org.threeten.bp.DateTimeException; import org.threeten.bp.DateTimeUtils; import org.threeten.bp.Instant; @@ -19,12 +21,10 @@ import org.threeten.bp.format.DateTimeFormatter; import org.threeten.bp.temporal.Temporal; import org.threeten.bp.temporal.TemporalAccessor; -import java.io.IOException; -import java.math.BigDecimal; - /** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. + * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link + * ZonedDateTime}s. Adapted from the jackson threetenbp InstantDeserializer to add support for + * deserializing rfc822 format. * * @author Nick Williams */ @@ -32,84 +32,89 @@ public class CustomInstantDeserializer extends ThreeTenDateTimeDeserializerBase { private static final long serialVersionUID = 1L; - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); + public static final CustomInstantDeserializer INSTANT = + new CustomInstantDeserializer( + Instant.class, + DateTimeFormatter.ISO_INSTANT, + new Function() { + @Override + public Instant apply(TemporalAccessor temporalAccessor) { + return Instant.from(temporalAccessor); + } + }, + new Function() { + @Override + public Instant apply(FromIntegerArguments a) { + return Instant.ofEpochMilli(a.value); + } + }, + new Function() { + @Override + public Instant apply(FromDecimalArguments a) { + return Instant.ofEpochSecond(a.integer, a.fraction); + } + }, + null); - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); + public static final CustomInstantDeserializer OFFSET_DATE_TIME = + new CustomInstantDeserializer( + OffsetDateTime.class, + DateTimeFormatter.ISO_OFFSET_DATE_TIME, + new Function() { + @Override + public OffsetDateTime apply(TemporalAccessor temporalAccessor) { + return OffsetDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromIntegerArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromDecimalArguments a) { + return OffsetDateTime.ofInstant( + Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { + return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); + } + }); - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); + public static final CustomInstantDeserializer ZONED_DATE_TIME = + new CustomInstantDeserializer( + ZonedDateTime.class, + DateTimeFormatter.ISO_ZONED_DATE_TIME, + new Function() { + @Override + public ZonedDateTime apply(TemporalAccessor temporalAccessor) { + return ZonedDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromIntegerArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromDecimalArguments a) { + return ZonedDateTime.ofInstant( + Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { + return zonedDateTime.withZoneSameInstant(zoneId); + } + }); protected final Function fromMilliseconds; @@ -119,22 +124,26 @@ public class CustomInstantDeserializer protected final BiFunction adjust; - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { + protected CustomInstantDeserializer( + Class supportedType, + DateTimeFormatter parser, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust) { super(supportedType, parser); this.parsedToValue = parsedToValue; this.fromMilliseconds = fromMilliseconds; this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; + this.adjust = + adjust == null + ? new BiFunction() { + @Override + public T apply(T t, ZoneId zoneId) { + return t; + } + } + : adjust; } @SuppressWarnings("unchecked") @@ -156,49 +165,50 @@ public class CustomInstantDeserializer @Override public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. + // NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only + // string values have to be adjusted to the configured TZ. switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } + case JsonTokenId.ID_NUMBER_FLOAT: + { + BigDecimal value = parser.getDecimalValue(); + long seconds = value.longValue(); + int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); + return fromNanoseconds.apply( + new FromDecimalArguments(seconds, nanoseconds, getZone(context))); + } - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); + case JsonTokenId.ID_NUMBER_INT: + { + long timestamp = parser.getLongValue(); + if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { + return this.fromNanoseconds.apply( + new FromDecimalArguments(timestamp, 0, this.getZone(context))); } - } catch (DateTimeException e) { - throw _peelDTE(e); + return this.fromMilliseconds.apply( + new FromIntegerArguments(timestamp, this.getZone(context))); + } + + case JsonTokenId.ID_STRING: + { + String string = parser.getText().trim(); + if (string.length() == 0) { + return null; + } + if (string.endsWith("+0000")) { + string = string.substring(0, string.length() - 5) + "Z"; + } + T value; + try { + TemporalAccessor acc = _formatter.parse(string); + value = parsedToValue.apply(acc); + if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { + return adjust.apply(value, this.getZone(context)); + } + } catch (DateTimeException e) { + throw _peelDTE(e); + } + return value; } - return value; - } } throw context.mappingException("Expected type float, integer, or string."); } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java index 6517dc877a..9ace1af627 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/JSON.java @@ -1,15 +1,12 @@ package org.openapitools.client; -import org.threeten.bp.*; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; -import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; - import java.text.DateFormat; - import javax.ws.rs.ext.ContextResolver; - +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.threeten.bp.*; public class JSON implements ContextResolver { private ObjectMapper mapper; @@ -34,6 +31,7 @@ public class JSON implements ContextResolver { /** * Set the date format for JSON (de)serialization with Date properties. + * * @param dateFormat Date format */ public void setDateFormat(DateFormat dateFormat) { @@ -44,4 +42,8 @@ public class JSON implements ContextResolver { public ObjectMapper getContext(Class type) { return mapper; } + + public ObjectMapper getMapper() { + return mapper; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java index ae89aa6145..ce6aa2ef97 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/Pair.java @@ -3,59 +3,57 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; - public class Pair { - private String name = ""; - private String value = ""; + private String name = ""; + private String value = ""; - public Pair (String name, String value) { - setName(name); - setValue(value); + public Pair(String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; } - private void setName(String name) { - if (!isValidString(name)) { - return; - } + this.name = name; + } - this.name = name; + private void setValue(String value) { + if (!isValidString(value)) { + return; } - private void setValue(String value) { - if (!isValidString(value)) { - return; - } + this.value = value; + } - this.value = value; + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; } - public String getName() { - return this.name; + if (arg.trim().isEmpty()) { + return false; } - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) { - return false; - } - - if (arg.trim().isEmpty()) { - return false; - } - - return true; - } + return true; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java index 9509fd0898..8b88105c76 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,11 +14,9 @@ package org.openapitools.client; import com.fasterxml.jackson.databind.util.ISO8601DateFormat; import com.fasterxml.jackson.databind.util.ISO8601Utils; - import java.text.FieldPosition; import java.util.Date; - public class RFC3339DateFormat extends ISO8601DateFormat { // Same as ISO8601DateFormat but serializing milliseconds. @@ -28,5 +26,4 @@ public class RFC3339DateFormat extends ISO8601DateFormat { toAppendTo.append(value); return toAppendTo; } - -} \ No newline at end of file +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java index a1107a8690..b307b65c57 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -2,57 +2,58 @@ package org.openapitools.client; import java.util.Map; -/** - * Representing a Server configuration. - */ +/** Representing a Server configuration. */ public class ServerConfiguration { - public String URL; - public String description; - public Map variables; + public String URL; + public String description; + public Map variables; - /** - * @param URL A URL to the target host. - * @param description A describtion of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } + /** + * @param URL A URL to the target host. + * @param description A describtion of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. + */ + public ServerConfiguration( + String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; + // go through variables and replace placeholders + for (Map.Entry variable : this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new RuntimeException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replaceAll("\\{" + name + "\\}", value); + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new RuntimeException( + "The variable " + name + " in the server URL has invalid value " + value + "."); } - return url; + } + url = url.replaceAll("\\{" + name + "\\}", value); } + return url; + } - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java index c2f13e2166..f5a0c96ed0 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/ServerVariable.java @@ -2,22 +2,21 @@ package org.openapitools.client; import java.util.HashSet; -/** - * Representing a Server Variable for server URL template substitution. - */ +/** Representing a Server Variable for server URL template substitution. */ public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; + public String description; + public String defaultValue; + public HashSet enumValues = null; - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java index 266c26be3a..70cd91e3b2 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/StringUtil.java @@ -3,17 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; - public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). @@ -36,12 +34,11 @@ public class StringUtil { /** * Join an array of strings with the given separator. - *

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

        * - * @param array The array of strings + *

        Note: This might be replaced by utility method from commons-lang or guava someday if one of + * those libraries is added as dependency. + * + * @param array The array of strings * @param separator The separator * @return the resulting string */ diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e06e72ecac..67f9b20ad7 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -1,20 +1,16 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - -import org.openapitools.client.model.Client; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.Client; public class AnotherFakeApi { private ApiClient apiClient; @@ -35,41 +31,42 @@ public class AnotherFakeApi { this.apiClient = apiClient; } /** - * To test special tags - * To test special tags and operation ID starting with number - * @param body client model (required) + * To test special tags To test special tags and operation ID starting with number + * + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public Client call123testSpecialTags(Client body) throws ApiException { - return call123testSpecialTagsWithHttpInfo(body).getData(); + public Client call123testSpecialTags(Client client) throws ApiException { + return call123testSpecialTagsWithHttpInfo(client).getData(); } /** - * To test special tags - * To test special tags and operation ID starting with number - * @param body client model (required) + * To test special tags To test special tags and operation ID starting with number + * + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse call123testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling call123testSpecialTags"); + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, "Missing the required parameter 'client' when calling call123testSpecialTags"); } - + // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -79,26 +76,29 @@ public class AnotherFakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("AnotherFakeApi.call123testSpecialTags", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "AnotherFakeApi.call123testSpecialTags", + localVarPath, + "PATCH", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/DefaultApi.java new file mode 100644 index 0000000000..b70b363a6f --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -0,0 +1,94 @@ +package org.openapitools.client.api; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.InlineResponseDefault; + +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + /** + * @return InlineResponseDefault + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
        Status Code Description Response Headers
        0 response -
        + */ + public InlineResponseDefault fooGet() throws ApiException { + return fooGetWithHttpInfo().getData(); + } + + /** + * @return ApiResponse<InlineResponseDefault> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
        Status Code Description Response Headers
        0 response -
        + */ + public ApiResponse fooGetWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/foo"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = {}; + + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {}; + + GenericType localVarReturnType = + new GenericType() {}; + + return apiClient.invokeAPI( + "DefaultApi.fooGet", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java index d077830e35..ea5b240a33 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeApi.java @@ -1,28 +1,25 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - -import java.math.BigDecimal; -import org.openapitools.client.model.Client; import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.User; -import org.openapitools.client.model.XmlItem; - +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.Pet; +import org.openapitools.client.model.User; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; public class FakeApi { private ApiClient apiClient; @@ -43,42 +40,36 @@ public class FakeApi { this.apiClient = apiClient; } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) + * Health check endpoint + * + * @return HealthCheckResult * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 The instance started successfully -
        */ - public void createXmlItem(XmlItem xmlItem) throws ApiException { - createXmlItemWithHttpInfo(xmlItem); + public HealthCheckResult fakeHealthGet() throws ApiException { + return fakeHealthGetWithHttpInfo().getData(); } /** - * creates an XmlItem - * this route creates an XmlItem - * @param xmlItem XmlItem Body (required) - * @return ApiResponse<Void> + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 The instance started successfully -
        */ - public ApiResponse createXmlItemWithHttpInfo(XmlItem xmlItem) throws ApiException { - Object localVarPostBody = xmlItem; - - // verify the required parameter 'xmlItem' is set - if (xmlItem == null) { - throw new ApiException(400, "Missing the required parameter 'xmlItem' when calling createXmlItem"); - } - + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables - String localVarPath = "/fake/create_xml_item"; + String localVarPath = "/fake/health"; // query params List localVarQueryParams = new ArrayList(); @@ -86,57 +77,142 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "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[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.createXmlItem", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI( + "FakeApi.fakeHealthGet", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); + } + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
        Status Code Description Response Headers
        200 The instance started successfully -
        + */ + public void fakeHttpSignatureTest(Pet pet, String query1, String header1) throws ApiException { + fakeHttpSignatureTestWithHttpInfo(pet, query1, header1); + } + + /** + * test http signature authentication + * + * @param pet Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + *
        Status Code Description Response Headers
        200 The instance started successfully -
        + */ + public ApiResponse fakeHttpSignatureTestWithHttpInfo(Pet pet, String query1, String header1) + throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException( + 400, "Missing the required parameter 'pet' when calling fakeHttpSignatureTest"); + } + + // create path and map variables + String localVarPath = "/fake/http-signature-test"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query_1", query1)); + + if (header1 != null) localVarHeaderParams.put("header_1", apiClient.parameterToString(header1)); + + final String[] localVarAccepts = {}; + + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = {"application/json", "application/xml"}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] {"http_signature_test"}; + + return apiClient.invokeAPI( + "FakeApi.fakeHttpSignatureTest", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * * Test serialization of outer boolean types + * * @param body Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output boolean -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output boolean -
        */ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); } /** - * * Test serialization of outer boolean types + * * @param body Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output boolean -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output boolean -
        */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) + throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -146,59 +222,64 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "*/*" - }; + final String[] localVarAccepts = {"*/*"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeApi.fakeOuterBooleanSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeApi.fakeOuterBooleanSerialize", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * + * @param outerComposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output composite -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output composite -
        */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - return fakeOuterCompositeSerializeWithHttpInfo(body).getData(); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) + throws ApiException { + return fakeOuterCompositeSerializeWithHttpInfo(outerComposite).getData(); } /** - * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * + * @param outerComposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output composite -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output composite -
        */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; - + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo( + OuterComposite outerComposite) throws ApiException { + Object localVarPostBody = outerComposite; + // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -208,59 +289,63 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "*/*" - }; + final String[] localVarAccepts = {"*/*"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeApi.fakeOuterCompositeSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeApi.fakeOuterCompositeSerialize", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * * Test serialization of outer number types + * * @param body Input number as post body (optional) * @return BigDecimal * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output number -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output number -
        */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { return fakeOuterNumberSerializeWithHttpInfo(body).getData(); } /** - * * Test serialization of outer number types + * * @param body Input number as post body (optional) * @return ApiResponse<BigDecimal> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output number -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output number -
        */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) + throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/number"; @@ -270,59 +355,62 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "*/*" - }; + final String[] localVarAccepts = {"*/*"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeApi.fakeOuterNumberSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeApi.fakeOuterNumberSerialize", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * * Test serialization of outer string types + * * @param body Input string as post body (optional) * @return String * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output string -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output string -
        */ public String fakeOuterStringSerialize(String body) throws ApiException { return fakeOuterStringSerializeWithHttpInfo(body).getData(); } /** - * * Test serialization of outer string types + * * @param body Input string as post body (optional) * @return ApiResponse<String> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Output string -
        + * + * + * + *
        Status Code Description Response Headers
        200 Output string -
        */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/string"; @@ -332,63 +420,69 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "*/*" - }; + final String[] localVarAccepts = {"*/*"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeApi.fakeOuterStringSerialize", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeApi.fakeOuterStringSerialize", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * * For this test, the body for this request much reference a schema named `File`. - * @param body (required) + * + * @param fileSchemaTestClass (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public void testBodyWithFileSchema(FileSchemaTestClass body) throws ApiException { - testBodyWithFileSchemaWithHttpInfo(body); + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); } /** - * * For this test, the body for this request much reference a schema named `File`. - * @param body (required) + * + * @param fileSchemaTestClass (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithFileSchema"); + public ApiResponse testBodyWithFileSchemaWithHttpInfo( + FileSchemaTestClass fileSchemaTestClass) throws ApiException { + Object localVarPostBody = fileSchemaTestClass; + + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException( + 400, + "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); } - + // create path and map variables String localVarPath = "/fake/body-with-file-schema"; @@ -398,68 +492,71 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testBodyWithFileSchema", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testBodyWithFileSchema", + localVarPath, + "PUT", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * - * - * @param query (required) - * @param body (required) + * @param query (required) + * @param user (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public void testBodyWithQueryParams(String query, User body) throws ApiException { - testBodyWithQueryParamsWithHttpInfo(query, body); + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); } /** - * - * - * @param query (required) - * @param body (required) + * @param query (required) + * @param user (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User body) throws ApiException { - Object localVarPostBody = body; - + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) + throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'query' is set if (query == null) { - throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + throw new ApiException( + 400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); } - + // create path and map variables String localVarPath = "/fake/body-with-query-params"; @@ -471,61 +568,67 @@ public class FakeApi { localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - - }; + final String[] localVarAccepts = {}; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testBodyWithQueryParams", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testBodyWithQueryParams", + localVarPath, + "PUT", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) + * To test \"client\" model To test \"client\" model + * + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public Client testClientModel(Client body) throws ApiException { - return testClientModelWithHttpInfo(body).getData(); + public Client testClientModel(Client client) throws ApiException { + return testClientModelWithHttpInfo(client).getData(); } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) + * To test \"client\" model To test \"client\" model + * + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, "Missing the required parameter 'client' when calling testClientModel"); } - + // create path and map variables String localVarPath = "/fake"; @@ -535,31 +638,35 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeApi.testClientModel", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeApi.testClientModel", + localVarPath, + "PATCH", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing + * various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * * @param number None (required) * @param _double None (required) * @param patternWithoutDelimiter None (required) @@ -576,19 +683,49 @@ public class FakeApi { * @param paramCallback None (optional) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + public void testEndpointParameters( + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + File binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback) + throws ApiException { + testEndpointParametersWithHttpInfo( + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing + * various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * * @param number None (required) * @param _double None (required) * @param patternWithoutDelimiter None (required) @@ -606,35 +743,55 @@ public class FakeApi { * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { + public ApiResponse testEndpointParametersWithHttpInfo( + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + File binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'number' is set if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); + throw new ApiException( + 400, "Missing the required parameter 'number' when calling testEndpointParameters"); } - + // verify the required parameter '_double' is set if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); + throw new ApiException( + 400, "Missing the required parameter '_double' when calling testEndpointParameters"); } - + // verify the required parameter 'patternWithoutDelimiter' is set if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); + throw new ApiException( + 400, + "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); } - + // verify the required parameter '_byte' is set if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + throw new ApiException( + 400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - + // create path and map variables String localVarPath = "/fake"; @@ -644,60 +801,54 @@ public class FakeApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) + if (integer != null) localVarFormParams.put("integer", integer); + if (int32 != null) localVarFormParams.put("int32", int32); + if (int64 != null) localVarFormParams.put("int64", int64); + if (number != null) localVarFormParams.put("number", number); + if (_float != null) localVarFormParams.put("float", _float); + if (_double != null) localVarFormParams.put("double", _double); + if (string != null) localVarFormParams.put("string", string); + if (patternWithoutDelimiter != null) localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -if (paramCallback != null) - localVarFormParams.put("callback", paramCallback); + if (_byte != null) localVarFormParams.put("byte", _byte); + if (binary != null) localVarFormParams.put("binary", binary); + if (date != null) localVarFormParams.put("date", date); + if (dateTime != null) localVarFormParams.put("dateTime", dateTime); + if (password != null) localVarFormParams.put("password", password); + if (paramCallback != null) localVarFormParams.put("callback", paramCallback); + + final String[] localVarAccepts = {}; - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "http_basic_test" }; + String[] localVarAuthNames = new String[] {"http_basic_test"}; - return apiClient.invokeAPI("FakeApi.testEndpointParameters", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testEndpointParameters", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>()) + * To test enum parameters To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to + * new ArrayList<String>()) * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new + * ArrayList<String>()) * @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) @@ -705,22 +856,41 @@ if (paramCallback != null) * @param enumFormString Form parameter enum test (string) (optional, default to -efg) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid request -
        404 Not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid request -
        404 Not found -
        */ - public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + public void testEnumParameters( + List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString) + throws ApiException { + testEnumParametersWithHttpInfo( + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumFormStringArray, + enumFormString); } /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to new ArrayList<String>()) + * To test enum parameters To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to + * new ArrayList<String>()) * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new ArrayList<String>()) + * @param enumQueryStringArray Query parameter enum test (string array) (optional, default to new + * ArrayList<String>()) * @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) @@ -729,15 +899,24 @@ if (paramCallback != null) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid request -
        404 Not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid request -
        404 Not found -
        */ - public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { + public ApiResponse testEnumParametersWithHttpInfo( + List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString) + throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/fake"; @@ -747,57 +926,81 @@ if (paramCallback != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "enum_query_double", enumQueryDouble)); if (enumHeaderStringArray != null) - localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + localVarHeaderParams.put( + "enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); + if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); - if (enumFormStringArray != null) localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) - localVarFormParams.put("enum_form_string", enumFormString); + if (enumFormString != null) localVarFormParams.put("enum_form_string", enumFormString); + + final String[] localVarAccepts = {}; - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testEnumParameters", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testEnumParameters", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } -private ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { + private ApiResponse testGroupParametersWithHttpInfo( + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, + Boolean booleanGroup, + Long int64Group) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'requiredStringGroup' is set if (requiredStringGroup == null) { - throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); + throw new ApiException( + 400, + "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); } - + // verify the required parameter 'requiredBooleanGroup' is set if (requiredBooleanGroup == null) { - throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); + throw new ApiException( + 400, + "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); } - + // verify the required parameter 'requiredInt64Group' is set if (requiredInt64Group == null) { - throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); + throw new ApiException( + 400, + "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - + // create path and map variables String localVarPath = "/fake"; @@ -807,33 +1010,43 @@ private ApiResponse testGroupParametersWithHttpInfo(Integer requiredString Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "required_string_group", requiredStringGroup)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "required_int64_group", requiredInt64Group)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "string_group", stringGroup)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "int64_group", int64Group)); if (requiredBooleanGroup != null) - localVarHeaderParams.put("required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); -if (booleanGroup != null) + localVarHeaderParams.put( + "required_boolean_group", apiClient.parameterToString(requiredBooleanGroup)); + if (booleanGroup != null) localVarHeaderParams.put("boolean_group", apiClient.parameterToString(booleanGroup)); - - - final String[] localVarAccepts = { - - }; + final String[] localVarAccepts = {}; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {"bearer_test"}; - return apiClient.invokeAPI("FakeApi.testGroupParameters", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testGroupParameters", + localVarPath, + "DELETE", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } public class APItestGroupParametersRequest { @@ -844,12 +1057,11 @@ if (booleanGroup != null) private Boolean booleanGroup; private Long int64Group; - private APItestGroupParametersRequest() { - } - + private APItestGroupParametersRequest() {} /** * Set requiredStringGroup + * * @param requiredStringGroup Required String in group parameters (required) * @return APItestGroupParametersRequest */ @@ -857,10 +1069,10 @@ if (booleanGroup != null) this.requiredStringGroup = requiredStringGroup; return this; } - /** * Set requiredBooleanGroup + * * @param requiredBooleanGroup Required Boolean in group parameters (required) * @return APItestGroupParametersRequest */ @@ -868,10 +1080,10 @@ if (booleanGroup != null) this.requiredBooleanGroup = requiredBooleanGroup; return this; } - /** * Set requiredInt64Group + * * @param requiredInt64Group Required Integer in group parameters (required) * @return APItestGroupParametersRequest */ @@ -879,10 +1091,10 @@ if (booleanGroup != null) this.requiredInt64Group = requiredInt64Group; return this; } - /** * Set stringGroup + * * @param stringGroup String in group parameters (optional) * @return APItestGroupParametersRequest */ @@ -890,10 +1102,10 @@ if (booleanGroup != null) this.stringGroup = stringGroup; return this; } - /** * Set booleanGroup + * * @param booleanGroup Boolean in group parameters (optional) * @return APItestGroupParametersRequest */ @@ -901,10 +1113,10 @@ if (booleanGroup != null) this.booleanGroup = booleanGroup; return this; } - /** * Set int64Group + * * @param int64Group Integer in group parameters (optional) * @return APItestGroupParametersRequest */ @@ -912,88 +1124,91 @@ if (booleanGroup != null) this.int64Group = int64Group; return this; } - /** * Execute testGroupParameters request - + * * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        400 Someting wrong -
        - + * + * + * + *
        Status Code Description Response Headers
        400 Someting wrong -
        */ - public void execute() throws ApiException { this.executeWithHttpInfo().getData(); } /** * Execute testGroupParameters request with HTTP info returned + * * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        400 Someting wrong -
        - + * + * + * + *
        Status Code Description Response Headers
        400 Someting wrong -
        */ - public ApiResponse executeWithHttpInfo() throws ApiException { - return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return testGroupParametersWithHttpInfo( + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); } } /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters + * (optional) + * * @return testGroupParametersRequest * @throws ApiException if fails to make API call - - */ - public APItestGroupParametersRequest testGroupParameters() throws ApiException { return new APItestGroupParametersRequest(); } /** * test inline additionalProperties - * - * @param param request body (required) + * + * @param requestBody request body (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public void testInlineAdditionalProperties(Map param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(Map requestBody) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); } /** * test inline additionalProperties - * - * @param param request body (required) + * + * @param requestBody request body (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map param) throws ApiException { - Object localVarPostBody = param; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo( + Map requestBody) throws ApiException { + Object localVarPostBody = requestBody; + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); } - + // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1003,37 +1218,41 @@ if (booleanGroup != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testInlineAdditionalProperties", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testInlineAdditionalProperties", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * test json serialization of form data - * + * * @param param field1 (required) * @param param2 field2 (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ public void testJsonFormData(String param, String param2) throws ApiException { testJsonFormDataWithHttpInfo(param, param2); @@ -1041,30 +1260,33 @@ if (booleanGroup != null) /** * test json serialization of form data - * + * * @param param field1 (required) * @param param2 field2 (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { + public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'param' is set if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); + throw new ApiException( + 400, "Missing the required parameter 'param' when calling testJsonFormData"); } - + // verify the required parameter 'param2' is set if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + throw new ApiException( + 400, "Missing the required parameter 'param2' when calling testJsonFormData"); } - + // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1074,93 +1296,118 @@ if (booleanGroup != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (param != null) localVarFormParams.put("param", param); + if (param2 != null) localVarFormParams.put("param2", param2); - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); + final String[] localVarAccepts = {}; - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testJsonFormData", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testJsonFormData", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { + public void testQueryParameterCollectionFormat( + List pipe, + List ioutil, + List http, + List url, + List context) + throws ApiException { testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); } /** - * * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 Success -
        + * + * + * + *
        Status Code Description Response Headers
        200 Success -
        */ - public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo( + List pipe, + List ioutil, + List http, + List url, + List context) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'pipe' is set if (pipe == null) { - throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); + throw new ApiException( + 400, + "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); } - + // verify the required parameter 'ioutil' is set if (ioutil == null) { - throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); + throw new ApiException( + 400, + "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); } - + // verify the required parameter 'http' is set if (http == null) { - throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); + throw new ApiException( + 400, + "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); } - + // verify the required parameter 'url' is set if (url == null) { - throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); + throw new ApiException( + 400, + "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); } - + // verify the required parameter 'context' is set if (context == null) { - throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); + throw new ApiException( + 400, + "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); } - + // create path and map variables String localVarPath = "/fake/test-query-paramters"; @@ -1170,29 +1417,35 @@ if (param2 != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "pipe", pipe)); + localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "pipe", pipe)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "ioutil", ioutil)); localVarQueryParams.addAll(apiClient.parameterToPairs("space", "http", http)); localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "url", url)); localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "context", context)); - - - - final String[] localVarAccepts = { - - }; + final String[] localVarAccepts = {}; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("FakeApi.testQueryParameterCollectionFormat", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "FakeApi.testQueryParameterCollectionFormat", + localVarPath, + "PUT", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index c7c0dcafc0..287707679a 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -1,20 +1,16 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - -import org.openapitools.client.model.Client; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.Client; public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -35,41 +31,42 @@ public class FakeClassnameTags123Api { this.apiClient = apiClient; } /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) + * To test class name in snake case To test class name in snake case + * + * @param client client model (required) * @return Client * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public Client testClassname(Client body) throws ApiException { - return testClassnameWithHttpInfo(body).getData(); + public Client testClassname(Client client) throws ApiException { + return testClassnameWithHttpInfo(client).getData(); } /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) + * To test class name in snake case To test class name in snake case + * + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + Object localVarPostBody = client; + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, "Missing the required parameter 'client' when calling testClassname"); } - + // create path and map variables String localVarPath = "/fake_classname_test"; @@ -79,26 +76,29 @@ public class FakeClassnameTags123Api { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json" - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "api_key_query" }; + String[] localVarAuthNames = new String[] {"api_key_query"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FakeClassnameTags123Api.testClassname", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "FakeClassnameTags123Api.testClassname", + localVarPath, + "PATCH", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java index 01476de66b..cb2abcf1bc 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/PetApi.java @@ -1,22 +1,18 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - import java.io.File; -import org.openapitools.client.model.ModelApiResponse; -import org.openapitools.client.model.Pet; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; public class PetApi { private ApiClient apiClient; @@ -38,41 +34,39 @@ public class PetApi { } /** * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) + * + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        405 Invalid input -
        + * + * + * + *
        Status Code Description Response Headers
        405 Invalid input -
        */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) + * + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        405 Invalid input -
        + * + * + * + *
        Status Code Description Response Headers
        405 Invalid input -
        */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); } - + // create path and map variables String localVarPath = "/pet"; @@ -82,38 +76,41 @@ public class PetApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; + final String[] localVarContentTypes = {"application/json", "application/xml"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; - return apiClient.invokeAPI("PetApi.addPet", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "PetApi.addPet", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * Deletes a pet - * + * * @param petId Pet id to delete (required) - * @param apiKey (optional) + * @param apiKey (optional) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid pet value -
        + * + * + * + *
        Status Code Description Response Headers
        400 Invalid pet value -
        */ public void deletePet(Long petId, String apiKey) throws ApiException { deletePetWithHttpInfo(petId, apiKey); @@ -121,29 +118,29 @@ public class PetApi { /** * Deletes a pet - * + * * @param petId Pet id to delete (required) - * @param apiKey (optional) + * @param apiKey (optional) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid pet value -
        + * + * + * + *
        Status Code Description Response Headers
        400 Invalid pet value -
        */ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); } - + // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = + "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -151,66 +148,73 @@ public class PetApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); - if (apiKey != null) - localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + final String[] localVarAccepts = {}; - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; - return apiClient.invokeAPI("PetApi.deletePet", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "PetApi.deletePet", + localVarPath, + "DELETE", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings + * Finds Pets by status Multiple status values can be provided with comma separated strings + * * @param status Status values that need to be considered for filter (required) * @return List<Pet> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid status value -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid status value -
        */ public List findPetsByStatus(List status) throws ApiException { return findPetsByStatusWithHttpInfo(status).getData(); } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings + * Finds Pets by status Multiple status values can be provided with comma separated strings + * * @param status Status values that need to be considered for filter (required) * @return ApiResponse<List<Pet>> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid status value -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid status value -
        */ - public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { + public ApiResponse> findPetsByStatusWithHttpInfo(List status) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'status' is set if (status == null) { - throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); + throw new ApiException( + 400, "Missing the required parameter 'status' when calling findPetsByStatus"); } - + // create path and map variables String localVarPath = "/pet/findByStatus"; @@ -222,39 +226,46 @@ public class PetApi { localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI("PetApi.findPetsByStatus", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "PetApi.findPetsByStatus", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, + * tag3 for testing. + * * @param tags Tags to filter by (required) * @return List<Pet> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid tag value -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid tag value -
        + * * @deprecated */ @Deprecated @@ -263,28 +274,31 @@ public class PetApi { } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, + * tag3 for testing. + * * @param tags Tags to filter by (required) * @return ApiResponse<List<Pet>> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid tag value -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid tag value -
        + * * @deprecated */ @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'tags' is set if (tags == null) { - throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); + throw new ApiException( + 400, "Missing the required parameter 'tags' when calling findPetsByTags"); } - + // create path and map variables String localVarPath = "/pet/findByTags"; @@ -296,70 +310,76 @@ public class PetApi { localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI("PetApi.findPetsByTags", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "PetApi.findPetsByTags", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * Find pet by ID - * Returns a single pet + * Find pet by ID Returns a single pet + * * @param petId ID of pet to return (required) * @return Pet * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        */ public Pet getPetById(Long petId) throws ApiException { return getPetByIdWithHttpInfo(petId).getData(); } /** - * Find pet by ID - * Returns a single pet + * Find pet by ID Returns a single pet + * * @param petId ID of pet to return (required) * @return ApiResponse<Pet> * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); } - + // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = + "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -367,69 +387,71 @@ public class PetApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] {"api_key"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("PetApi.getPetById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "PetApi.getPetById", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) + * + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException if fails to make API call * @http.response.details - - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        405 Validation exception -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Pet not found -
        405 Validation exception -
        */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) + * + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Pet not found -
        405 Validation exception -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Pet not found -
        405 Validation exception -
        */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + Object localVarPostBody = pet; + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); } - + // create path and map variables String localVarPath = "/pet"; @@ -439,38 +461,42 @@ public class PetApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; + final String[] localVarContentTypes = {"application/json", "application/xml"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; - return apiClient.invokeAPI("PetApi.updatePet", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "PetApi.updatePet", + localVarPath, + "PUT", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * Updates a pet in the store with form data - * + * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        405 Invalid input -
        + * + * + * + *
        Status Code Description Response Headers
        405 Invalid input -
        */ public void updatePetWithForm(Long petId, String name, String status) throws ApiException { updatePetWithFormWithHttpInfo(petId, name, status); @@ -478,29 +504,32 @@ public class PetApi { /** * Updates a pet in the store with form data - * + * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        405 Invalid input -
        + * + * + * + *
        Status Code Description Response Headers
        405 Invalid input -
        */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling updatePetWithForm"); } - + // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = + "/pet/{petId}" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -508,73 +537,79 @@ public class PetApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (name != null) localVarFormParams.put("name", name); + if (status != null) localVarFormParams.put("status", status); - - - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); + final String[] localVarAccepts = {}; - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; + final String[] localVarContentTypes = {"application/x-www-form-urlencoded"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; - return apiClient.invokeAPI("PetApi.updatePetWithForm", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "PetApi.updatePetWithForm", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * uploads an image - * + * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ModelApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) + throws ApiException { return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData(); } /** * uploads an image - * + * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { + public ApiResponse uploadFileWithHttpInfo( + Long petId, String additionalMetadata, File file) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); } - + // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = + "/pet/{petId}/uploadImage" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -582,80 +617,90 @@ if (status != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); + if (file != null) localVarFormParams.put("file", file); - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "multipart/form-data" - }; + final String[] localVarContentTypes = {"multipart/form-data"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "PetApi.uploadFile", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** * uploads an image (required) - * + * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional) * @return ModelApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata).getData(); + public ModelApiResponse uploadFileWithRequiredFile( + Long petId, File requiredFile, String additionalMetadata) throws ApiException { + return uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata) + .getData(); } /** * uploads an image (required) - * + * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) * @param additionalMetadata Additional data to pass to server (optional) * @return ApiResponse<ModelApiResponse> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { + public ApiResponse uploadFileWithRequiredFileWithHttpInfo( + Long petId, File requiredFile, String additionalMetadata) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'petId' is set if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); } - + // verify the required parameter 'requiredFile' is set if (requiredFile == null) { - throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + throw new ApiException( + 400, + "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); } - + // create path and map variables - String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); + String localVarPath = + "/fake/{petId}/uploadImageWithRequiredFile" + .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -663,30 +708,33 @@ if (file != null) Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (requiredFile != null) - localVarFormParams.put("requiredFile", requiredFile); + if (requiredFile != null) localVarFormParams.put("requiredFile", requiredFile); - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - "multipart/form-data" - }; + final String[] localVarContentTypes = {"multipart/form-data"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "petstore_auth" }; + String[] localVarAuthNames = new String[] {"petstore_auth"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("PetApi.uploadFileWithRequiredFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "PetApi.uploadFileWithRequiredFile", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java index 11496944ef..90fdbd917a 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/StoreApi.java @@ -1,20 +1,16 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - -import org.openapitools.client.model.Order; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.Order; public class StoreApi { private ApiClient apiClient; @@ -35,45 +31,49 @@ public class StoreApi { this.apiClient = apiClient; } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything + * above 1000 or nonintegers will generate API errors + * * @param orderId ID of the order that needs to be deleted (required) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Order not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Order not found -
        */ public void deleteOrder(String orderId) throws ApiException { deleteOrderWithHttpInfo(orderId); } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything + * above 1000 or nonintegers will generate API errors + * * @param orderId ID of the order that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Order not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid ID supplied -
        404 Order not found -
        */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'orderId' is set if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); + throw new ApiException( + 400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - + // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = + "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -81,55 +81,60 @@ public class StoreApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("StoreApi.deleteOrder", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "StoreApi.deleteOrder", + localVarPath, + "DELETE", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities + * Returns pet inventories by status Returns a map of status codes to quantities + * * @return Map<String, Integer> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ public Map getInventory() throws ApiException { return getInventoryWithHttpInfo().getData(); } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities + * Returns pet inventories by status Returns a map of status codes to quantities + * * @return ApiResponse<Map<String, Integer>> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        200 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/inventory"; @@ -139,71 +144,80 @@ public class StoreApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; + final String[] localVarAccepts = {"application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { "api_key" }; + String[] localVarAuthNames = new String[] {"api_key"}; - GenericType> localVarReturnType = new GenericType>() {}; + GenericType> localVarReturnType = + new GenericType>() {}; - return apiClient.invokeAPI("StoreApi.getInventory", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "StoreApi.getInventory", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID For valid response try integer IDs with value <= 5 or > + * 10. Other values will generated exceptions + * * @param orderId ID of pet that needs to be fetched (required) * @return Order * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Order not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Order not found -
        */ public Order getOrderById(Long orderId) throws ApiException { return getOrderByIdWithHttpInfo(orderId).getData(); } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * Find purchase order by ID For valid response try integer IDs with value <= 5 or > + * 10. Other values will generated exceptions + * * @param orderId ID of pet that needs to be fetched (required) * @return ApiResponse<Order> * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Order not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid ID supplied -
        404 Order not found -
        */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'orderId' is set if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); + throw new ApiException( + 400, "Missing the required parameter 'orderId' when calling getOrderById"); } - + // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); + String localVarPath = + "/store/order/{order_id}" + .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -211,66 +225,70 @@ public class StoreApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("StoreApi.getOrderById", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "StoreApi.getOrderById", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) + * + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid Order -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid Order -
        */ - public Order placeOrder(Order body) throws ApiException { - return placeOrderWithHttpInfo(body).getData(); + public Order placeOrder(Order order) throws ApiException { + return placeOrderWithHttpInfo(order).getData(); } /** * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) + * + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid Order -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid Order -
        */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + Object localVarPostBody = order; + + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); } - + // create path and map variables String localVarPath = "/store/order"; @@ -280,26 +298,29 @@ public class StoreApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("StoreApi.placeOrder", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "StoreApi.placeOrder", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java index 1f9d6afe11..369322b43c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,20 +1,16 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Configuration; -import org.openapitools.client.Pair; - -import javax.ws.rs.core.GenericType; - -import org.openapitools.client.model.User; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - +import javax.ws.rs.core.GenericType; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Configuration; +import org.openapitools.client.Pair; +import org.openapitools.client.model.User; public class UserApi { private ApiClient apiClient; @@ -35,40 +31,40 @@ public class UserApi { this.apiClient = apiClient; } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) + * Create user This can only be done by the logged in user. + * + * @param user Created user object (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) + * Create user This can only be done by the logged in user. + * + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } - + // create path and map variables String localVarPath = "/user"; @@ -78,61 +74,67 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.createUser", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.createUser", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * Creates list of users with given input array - * - * @param body List of user object (required) + * + * @param user List of user object (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public void createUsersWithArrayInput(List body) throws ApiException { - createUsersWithArrayInputWithHttpInfo(body); + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); } /** * Creates list of users with given input array - * - * @param body List of user object (required) + * + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) + throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } - + // create path and map variables String localVarPath = "/user/createWithArray"; @@ -142,61 +144,67 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.createUsersWithArrayInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.createUsersWithArrayInput", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * Creates list of users with given input array - * - * @param body List of user object (required) + * + * @param user List of user object (required) * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public void createUsersWithListInput(List body) throws ApiException { - createUsersWithListInputWithHttpInfo(body); + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); } /** * Creates list of users with given input array - * - * @param body List of user object (required) + * + * @param user List of user object (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); + public ApiResponse createUsersWithListInputWithHttpInfo(List user) + throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, "Missing the required parameter 'user' when calling createUsersWithListInput"); } - + // create path and map variables String localVarPath = "/user/createWithList"; @@ -206,66 +214,72 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.createUsersWithListInput", localVarPath, "POST", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.createUsersWithListInput", + localVarPath, + "POST", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * Delete user - * This can only be done by the logged in user. + * Delete user This can only be done by the logged in user. + * * @param username The name that needs to be deleted (required) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        */ public void deleteUser(String username) throws ApiException { deleteUserWithHttpInfo(username); } /** - * Delete user - * This can only be done by the logged in user. + * Delete user This can only be done by the logged in user. + * * @param username The name that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid username supplied -
        404 User not found -
        */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); + throw new ApiException( + 400, "Missing the required parameter 'username' when calling deleteUser"); } - + // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = + "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -273,39 +287,44 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.deleteUser", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.deleteUser", + localVarPath, + "DELETE", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** * Get user by user name - * + * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid username supplied -
        404 User not found -
        */ public User getUserByName(String username) throws ApiException { return getUserByNameWithHttpInfo(username).getData(); @@ -313,29 +332,31 @@ public class UserApi { /** * Get user by user name - * + * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return ApiResponse<User> * @throws ApiException if fails to make API call * @http.response.details - - - - - -
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid username supplied -
        404 User not found -
        + * + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation -
        400 Invalid username supplied -
        404 User not found -
        */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); + throw new ApiException( + 400, "Missing the required parameter 'username' when calling getUserByName"); } - + // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = + "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -343,41 +364,45 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("UserApi.getUserByName", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "UserApi.getUserByName", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** * Logs user into the system - * + * * @param username The user name for login (required) * @param password The password for login in clear text (required) * @return String * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation * X-Rate-Limit - calls per hour allowed by the user
        * X-Expires-After - date in UTC when token expires
        400 Invalid username/password supplied -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation * X-Rate-Limit - calls per hour allowed by the user
        * X-Expires-After - date in UTC when token expires
        400 Invalid username/password supplied -
        */ public String loginUser(String username, String password) throws ApiException { return loginUserWithHttpInfo(username, password).getData(); @@ -385,31 +410,34 @@ public class UserApi { /** * Logs user into the system - * + * * @param username The user name for login (required) * @param password The password for login in clear text (required) * @return ApiResponse<String> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        200 successful operation * X-Rate-Limit - calls per hour allowed by the user
        * X-Expires-After - date in UTC when token expires
        400 Invalid username/password supplied -
        + * + * + * + * + *
        Status Code Description Response Headers
        200 successful operation * X-Rate-Limit - calls per hour allowed by the user
        * X-Expires-After - date in UTC when token expires
        400 Invalid username/password supplied -
        */ - public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { + public ApiResponse loginUserWithHttpInfo(String username, String password) + throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); + throw new ApiException( + 400, "Missing the required parameter 'username' when calling loginUser"); } - + // verify the required parameter 'password' is set if (password == null) { - throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); + throw new ApiException( + 400, "Missing the required parameter 'password' when calling loginUser"); } - + // create path and map variables String localVarPath = "/user/login"; @@ -422,36 +450,41 @@ public class UserApi { localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; + final String[] localVarAccepts = {"application/xml", "application/json"}; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("UserApi.loginUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, null); + return apiClient.invokeAPI( + "UserApi.loginUser", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + null); } /** * Logs out current logged in user session - * + * * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ public void logoutUser() throws ApiException { logoutUserWithHttpInfo(); @@ -459,18 +492,18 @@ public class UserApi { /** * Logs out current logged in user session - * + * * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - -
        Status Code Description Response Headers
        0 successful operation -
        + * + * + * + *
        Status Code Description Response Headers
        0 successful operation -
        */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/logout"; @@ -480,73 +513,80 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {}; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.logoutUser", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.logoutUser", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } /** - * Updated user - * This can only be done by the logged in user. + * 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) + * @param user Updated user object (required) * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid user supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid user supplied -
        404 User not found -
        */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); } /** - * Updated user - * This can only be done by the logged in user. + * 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) + * @param user Updated user object (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details - - - - -
        Status Code Description Response Headers
        400 Invalid user supplied -
        404 User not found -
        + * + * + * + * + *
        Status Code Description Response Headers
        400 Invalid user supplied -
        404 User not found -
        */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; - + public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { + Object localVarPostBody = user; + // verify the required parameter 'username' is set if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); + throw new ApiException( + 400, "Missing the required parameter 'username' when calling updateUser"); } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); } - + // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); + String localVarPath = + "/user/{username}" + .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -554,24 +594,28 @@ public class UserApi { Map localVarCookieParams = new HashMap(); Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = {}; - - - - final String[] localVarAccepts = { - - }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = { - - }; + final String[] localVarContentTypes = {"application/json"}; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - String[] localVarAuthNames = new String[] { }; + String[] localVarAuthNames = new String[] {}; - return apiClient.invokeAPI("UserApi.updateUser", localVarPath, "PUT", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, null); + return apiClient.invokeAPI( + "UserApi.updateUser", + localVarPath, + "PUT", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + null); } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index a9427105d8..e77ca74a38 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -3,21 +3,20 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; -import org.openapitools.client.Pair; - -import java.util.Map; +import java.net.URI; import java.util.List; - +import java.util.Map; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class ApiKeyAuth implements Authentication { private final String location; @@ -56,7 +55,14 @@ public class ApiKeyAuth implements Authentication { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (apiKey == null) { return; } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java index 5c558b1d5a..b2f568ccf5 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/Authentication.java @@ -3,28 +3,35 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; +import java.net.URI; +import java.util.List; +import java.util.Map; +import org.openapitools.client.ApiException; import org.openapitools.client.Pair; -import java.util.Map; -import java.util.List; - public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams); + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException; } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 98993417be..208509bfe8 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -3,25 +3,22 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; -import org.openapitools.client.Pair; - import com.migcomponents.migbase64.Base64; - -import java.util.Map; -import java.util.List; - import java.io.UnsupportedEncodingException; - +import java.net.URI; +import java.util.List; +import java.util.Map; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class HttpBasicAuth implements Authentication { private String username; @@ -44,13 +41,21 @@ public class HttpBasicAuth implements Authentication { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (username == null && password == null) { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); + headerParams.put( + "Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java index e20259cb94..c932a74566 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpBearerAuth.java @@ -3,21 +3,20 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; -import org.openapitools.client.Pair; - -import java.util.Map; +import java.net.URI; import java.util.List; - +import java.util.Map; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class HttpBearerAuth implements Authentication { private final String scheme; @@ -28,7 +27,8 @@ public class HttpBearerAuth implements Authentication { } /** - * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * Gets the token, which together with the scheme, will be sent as the value of the Authorization + * header. * * @return The bearer token */ @@ -37,7 +37,8 @@ public class HttpBearerAuth implements Authentication { } /** - * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * Sets the token, which together with the scheme, will be sent as the value of the Authorization + * header. * * @param bearerToken The bearer token to send in the Authorization header */ @@ -46,12 +47,20 @@ public class HttpBearerAuth implements Authentication { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { - if(bearerToken == null) { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + if (bearerToken == null) { return; } - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + headerParams.put( + "Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); } private static String upperCaseBearer(String scheme) { diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java new file mode 100644 index 0000000000..c98091bad0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/HttpSignatureAuth.java @@ -0,0 +1,141 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.auth; + +import java.net.URI; +import java.net.URLEncoder; +import java.security.Key; +import java.security.MessageDigest; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; +import org.tomitribe.auth.signatures.*; + +public class HttpSignatureAuth implements Authentication { + + private Signer signer; + + private String name; + + private Algorithm algorithm; + + private List headers; + + public HttpSignatureAuth(String name, Algorithm algorithm, List headers) { + this.name = name; + this.algorithm = algorithm; + this.headers = headers; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Algorithm getAlgorithm() { + return algorithm; + } + + public void setAlgorithm(Algorithm algorithm) { + this.algorithm = algorithm; + } + + public List getHeaders() { + return headers; + } + + public void setHeaders(List headers) { + this.headers = headers; + } + + public Signer getSigner() { + return signer; + } + + public void setSigner(Signer signer) { + this.signer = signer; + } + + public void setup(Key key) throws ApiException { + if (key == null) { + throw new ApiException("key (java.security.Key) cannot be null"); + } + + signer = new Signer(key, new Signature(name, algorithm, null, headers)); + } + + @Override + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + try { + if (headers.contains("host")) { + headerParams.put("host", uri.getHost()); + } + + if (headers.contains("date")) { + headerParams.put( + "date", + new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US).format(new Date())); + } + + if (headers.contains("digest")) { + headerParams.put( + "digest", + "SHA-256=" + + new String( + Base64.getEncoder() + .encode(MessageDigest.getInstance("SHA-256").digest(payload.getBytes())))); + } + + if (signer == null) { + throw new ApiException( + "Signer cannot be null. Please run the method `setup` to set it up correctly"); + } + + // construct the path with the URL query string + String path = uri.getPath(); + + List urlQueries = new ArrayList(); + for (Pair queryParam : queryParams) { + urlQueries.add( + queryParam.getName() + + "=" + + URLEncoder.encode(queryParam.getValue(), "utf8").replaceAll("\\+", "%20")); + } + + if (!urlQueries.isEmpty()) { + path = path + "?" + String.join("&", urlQueries); + } + + headerParams.put("Authorization", signer.sign(method, path, headerParams).toString()); + } catch (Exception ex) { + throw new ApiException( + "Failed to create signature in the HTTP request header: " + ex.toString()); + } + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java index 779680c9b2..c7302cbcbd 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuth.java @@ -3,21 +3,20 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; -import org.openapitools.client.Pair; - -import java.util.Map; +import java.net.URI; import java.util.List; - +import java.util.Map; +import org.openapitools.client.ApiException; +import org.openapitools.client.Pair; public class OAuth implements Authentication { private String accessToken; @@ -31,7 +30,14 @@ public class OAuth implements Authentication { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams) { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (accessToken != null) { headerParams.put("Authorization", "Bearer " + accessToken); } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java index b2d11ff0c4..1e09cd99af 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/auth/OAuthFlow.java @@ -3,16 +3,18 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.auth; public enum OAuthFlow { - accessCode, implicit, password, application + accessCode, + implicit, + password, + application } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index 28cf630a27..54b31cc472 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -3,39 +3,39 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.openapitools.client.ApiException; -import java.lang.reflect.Type; import java.util.Map; import javax.ws.rs.core.GenericType; - public abstract class AbstractOpenApiSchema { - private Object instance; + private Object instance; - public final String schemaType; + public final String schemaType; - public AbstractOpenApiSchema(String schemaType) { - this.schemaType = schemaType; - } + public AbstractOpenApiSchema(String schemaType) { + this.schemaType = schemaType; + } - public abstract Map getSchemas(); + public abstract Map getSchemas(); - public Object getActualInstance() {return instance;} + public Object getActualInstance() { + return instance; + } - public void setActualInstance(Object instance) {this.instance = instance;} + public void setActualInstance(Object instance) { + this.instance = instance; + } - public String getSchemaType() { - return schemaType; - } + public String getSchemaType() { + return schemaType; + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java deleted file mode 100644 index c03535ab94..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * AdditionalPropertiesArray - */ -@JsonPropertyOrder({ - AdditionalPropertiesArray.JSON_PROPERTY_NAME -}) - -public class AdditionalPropertiesArray extends HashMap { - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index 4356a4f8c1..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * AdditionalPropertiesBoolean - */ -@JsonPropertyOrder({ - AdditionalPropertiesBoolean.JSON_PROPERTY_NAME -}) - -public class AdditionalPropertiesBoolean extends HashMap { - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 781d4686e9..7d984f4458 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -3,421 +3,99 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; -/** - * AdditionalPropertiesClass - */ +/** AdditionalPropertiesClass */ @JsonPropertyOrder({ - AdditionalPropertiesClass.JSON_PROPERTY_MAP_STRING, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_NUMBER, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_INTEGER, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_BOOLEAN, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_INTEGER, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_ARRAY_ANYTYPE, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_STRING, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_MAP_ANYTYPE, - AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, - AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE2, - AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE3 + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY }) - public class AdditionalPropertiesClass { - public static final String JSON_PROPERTY_MAP_STRING = "map_string"; - private Map mapString = null; + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + private Map mapProperty = null; - public static final String JSON_PROPERTY_MAP_NUMBER = "map_number"; - private Map mapNumber = null; + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + private Map> mapOfMapProperty = null; - public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer"; - private Map mapInteger = null; + public AdditionalPropertiesClass mapProperty(Map mapProperty) { - 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_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_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_ANYTYPE2 = "anytype_2"; - private Object anytype2; - - public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3"; - private Object anytype3; - - - public AdditionalPropertiesClass mapString(Map mapString) { - - this.mapString = mapString; + this.mapProperty = mapProperty; return this; } - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap(); + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap(); } - this.mapString.put(key, mapStringItem); + this.mapProperty.put(key, mapPropertyItem); return this; } - /** - * Get mapString - * @return mapString - **/ + /** + * Get mapProperty + * + * @return mapProperty + */ @javax.annotation.Nullable @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_STRING) + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapString() { - return mapString; + public Map getMapProperty() { + return mapProperty; } - - public void setMapString(Map mapString) { - this.mapString = mapString; + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } + public AdditionalPropertiesClass mapOfMapProperty( + Map> mapOfMapProperty) { - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - - this.mapNumber = mapNumber; + this.mapOfMapProperty = mapOfMapProperty; return this; } - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap(); + public AdditionalPropertiesClass putMapOfMapPropertyItem( + String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap>(); } - this.mapNumber.put(key, mapNumberItem); + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - /** - * Get mapNumber - * @return mapNumber - **/ + /** + * Get mapOfMapProperty + * + * @return mapOfMapProperty + */ @javax.annotation.Nullable @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_NUMBER) + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapNumber() { - return mapNumber; + public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } - - 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(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapInteger() { - return mapInteger; - } - - - 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(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapBoolean() { - return mapBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map> getMapMapString() { - return mapMapString; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - - public AdditionalPropertiesClass anytype1(Object anytype1) { - - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getAnytype1() { - return anytype1; - } - - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - - public AdditionalPropertiesClass anytype2(Object anytype2) { - - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getAnytype2() { - return anytype2; - } - - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - - public AdditionalPropertiesClass anytype3(Object anytype3) { - - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_ANYTYPE3) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getAnytype3() { - return anytype3; - } - - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -427,47 +105,27 @@ public class AdditionalPropertiesClass { 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); + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) + && Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty); } - @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(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -475,6 +133,4 @@ public class AdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java deleted file mode 100644 index 2426e7c974..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * AdditionalPropertiesInteger - */ -@JsonPropertyOrder({ - AdditionalPropertiesInteger.JSON_PROPERTY_NAME -}) - -public class AdditionalPropertiesInteger extends HashMap { - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java deleted file mode 100644 index da407ccdc4..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * AdditionalPropertiesNumber - */ -@JsonPropertyOrder({ - AdditionalPropertiesNumber.JSON_PROPERTY_NAME -}) - -public class AdditionalPropertiesNumber extends HashMap { - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - 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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java index e0ae875483..0be31d514f 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Animal.java @@ -3,43 +3,34 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Animal - */ -@JsonPropertyOrder({ - Animal.JSON_PROPERTY_CLASS_NAME, - Animal.JSON_PROPERTY_COLOR -}) - -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true) +/** Animal */ +@JsonPropertyOrder({Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR}) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "className", + visible = true) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), }) - public class Animal { public static final String JSON_PROPERTY_CLASS_NAME = "className"; private String className; @@ -47,56 +38,51 @@ public class Animal { public static final String JSON_PROPERTY_COLOR = "color"; private String color = "red"; - public Animal className(String className) { - + this.className = className; return this; } - /** + /** * Get className + * * @return className - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_CLASS_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - public Animal color(String color) { - + this.color = color; return this; } - /** + /** * Get color + * * @return color - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_COLOR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -106,8 +92,8 @@ public class Animal { return false; } Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return Objects.equals(this.className, animal.className) + && Objects.equals(this.color, animal.color); } @Override @@ -115,7 +101,6 @@ public class Animal { return Objects.hash(className, color); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -127,8 +112,7 @@ public class Animal { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -136,6 +120,4 @@ public class Animal { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 96f829bc64..fc5cfed290 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -3,43 +3,32 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * ArrayOfArrayOfNumberOnly - */ -@JsonPropertyOrder({ - ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER -}) +import java.util.Objects; +/** ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER}) public class ArrayOfArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; private List> arrayArrayNumber = null; - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - + this.arrayArrayNumber = arrayArrayNumber; return this; } @@ -52,25 +41,23 @@ public class ArrayOfArrayOfNumberOnly { return this; } - /** + /** * Get arrayArrayNumber + * * @return arrayArrayNumber - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,7 +75,6 @@ public class ArrayOfArrayOfNumberOnly { return Objects.hash(arrayArrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,8 +85,7 @@ public class ArrayOfArrayOfNumberOnly { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -108,6 +93,4 @@ public class ArrayOfArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 37e40dbd3e..6d4b1ba077 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -3,43 +3,32 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * ArrayOfNumberOnly - */ -@JsonPropertyOrder({ - ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER -}) +import java.util.Objects; +/** ArrayOfNumberOnly */ +@JsonPropertyOrder({ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER}) public class ArrayOfNumberOnly { public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; private List arrayNumber = null; - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - + this.arrayNumber = arrayNumber; return this; } @@ -52,25 +41,23 @@ public class ArrayOfNumberOnly { return this; } - /** + /** * Get arrayNumber + * * @return arrayNumber - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,7 +75,6 @@ public class ArrayOfNumberOnly { return Objects.hash(arrayNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -99,8 +85,7 @@ public class ArrayOfNumberOnly { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -108,6 +93,4 @@ public class ArrayOfNumberOnly { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java index de7c895ac9..b7b468f33e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -3,38 +3,29 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * ArrayTest - */ +/** ArrayTest */ @JsonPropertyOrder({ ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) - public class ArrayTest { public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; private List arrayOfString = null; @@ -45,9 +36,8 @@ public class ArrayTest { 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; } @@ -60,27 +50,25 @@ public class ArrayTest { return this; } - /** + /** * Get arrayOfString + * * @return arrayOfString - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - + this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } @@ -93,27 +81,25 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfInteger + * * @return arrayArrayOfInteger - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - + this.arrayArrayOfModel = arrayArrayOfModel; return this; } @@ -126,25 +112,23 @@ public class ArrayTest { return this; } - /** + /** * Get arrayArrayOfModel + * * @return arrayArrayOfModel - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,9 +138,9 @@ public class ArrayTest { 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); + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) + && Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) + && Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); } @Override @@ -164,21 +148,21 @@ public class ArrayTest { 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(" 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). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -186,6 +170,4 @@ public class ArrayTest { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java deleted file mode 100644 index 84b3f05703..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCat.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.BigCatAllOf; -import org.openapitools.client.model.Cat; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * BigCat - */ -@JsonPropertyOrder({ - BigCat.JSON_PROPERTY_KIND -}) - -public class BigCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String 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 kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(java.lang.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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java deleted file mode 100644 index 7ce0ddb21f..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * BigCatAllOf - */ -@JsonPropertyOrder({ - BigCatAllOf.JSON_PROPERTY_KIND -}) - -public class BigCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String 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 kind(KindEnum kind) { - - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - @Override - public boolean equals(java.lang.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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java index 033e978811..a152526a20 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Capitalization.java @@ -3,29 +3,22 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Capitalization - */ +/** Capitalization */ @JsonPropertyOrder({ Capitalization.JSON_PROPERTY_SMALL_CAMEL, Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, @@ -34,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) - public class Capitalization { public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; private String smallCamel; @@ -54,157 +46,144 @@ public class Capitalization { public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; private String ATT_NAME; - public Capitalization smallCamel(String smallCamel) { - + this.smallCamel = smallCamel; return this; } - /** + /** * Get smallCamel + * * @return smallCamel - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - public Capitalization capitalCamel(String capitalCamel) { - + this.capitalCamel = capitalCamel; return this; } - /** + /** * Get capitalCamel + * * @return capitalCamel - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - public Capitalization smallSnake(String smallSnake) { - + this.smallSnake = smallSnake; return this; } - /** + /** * Get smallSnake + * * @return smallSnake - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - public Capitalization capitalSnake(String capitalSnake) { - + this.capitalSnake = capitalSnake; return this; } - /** + /** * Get capitalSnake + * * @return capitalSnake - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - + this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** + /** * Get scAETHFlowPoints + * * @return scAETHFlowPoints - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - public Capitalization ATT_NAME(String ATT_NAME) { - + this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet + /** + * Name of the pet + * * @return ATT_NAME - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "Name of the pet ") @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -214,20 +193,20 @@ public class Capitalization { 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); + 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); + return Objects.hash( + smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -243,8 +222,7 @@ public class Capitalization { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -252,6 +230,4 @@ public class Capitalization { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java index 484725c76f..ac0b84d82e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Cat.java @@ -3,65 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.CatAllOf; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Cat - */ -@JsonPropertyOrder({ - Cat.JSON_PROPERTY_DECLAWED -}) - +/** Cat */ +@JsonPropertyOrder({Cat.JSON_PROPERTY_DECLAWED}) public class Cat extends Animal { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; - public Cat declawed(Boolean declawed) { - + this.declawed = declawed; return this; } - /** + /** * Get declawed + * * @return declawed - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -71,8 +56,7 @@ public class Cat extends Animal { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); + return Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override @@ -80,7 +64,6 @@ public class Cat extends Animal { return Objects.hash(declawed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -92,8 +75,7 @@ public class Cat extends Animal { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -101,6 +83,4 @@ public class Cat extends Animal { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java index 3e7b991436..a7e4beaad6 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -3,63 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * CatAllOf - */ -@JsonPropertyOrder({ - CatAllOf.JSON_PROPERTY_DECLAWED -}) - +/** CatAllOf */ +@JsonPropertyOrder({CatAllOf.JSON_PROPERTY_DECLAWED}) public class CatAllOf { public static final String JSON_PROPERTY_DECLAWED = "declawed"; private Boolean declawed; - public CatAllOf declawed(Boolean declawed) { - + this.declawed = declawed; return this; } - /** + /** * Get declawed + * * @return declawed - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DECLAWED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,7 +64,6 @@ public class CatAllOf { return Objects.hash(declawed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,8 +74,7 @@ public class CatAllOf { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -97,6 +82,4 @@ public class CatAllOf { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java index 868ba87507..617b395ecf 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Category.java @@ -3,34 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Category - */ -@JsonPropertyOrder({ - Category.JSON_PROPERTY_ID, - Category.JSON_PROPERTY_NAME -}) - +/** Category */ +@JsonPropertyOrder({Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME}) public class Category { public static final String JSON_PROPERTY_ID = "id"; private Long id; @@ -38,56 +27,51 @@ public class Category { public static final String JSON_PROPERTY_NAME = "name"; private String name = "default-name"; - public Category id(Long id) { - + this.id = id; return this; } - /** + /** * Get id + * * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - public Category name(String name) { - + this.name = name; return this; } - /** + /** * Get name + * * @return name - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - public void setName(String name) { this.name = name; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -97,8 +81,7 @@ public class Category { return false; } Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); + return Objects.equals(this.id, category.id) && Objects.equals(this.name, category.name); } @Override @@ -106,7 +89,6 @@ public class Category { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -118,8 +100,7 @@ public class Category { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -127,6 +108,4 @@ public class Category { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java index 4de7664b26..13bf74694c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ClassModel.java @@ -3,64 +3,52 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Model for testing model with \"_class\" property - */ +/** Model for testing model with \"_class\" property */ @ApiModel(description = "Model for testing model with \"_class\" property") -@JsonPropertyOrder({ - ClassModel.JSON_PROPERTY_PROPERTY_CLASS -}) - +@JsonPropertyOrder({ClassModel.JSON_PROPERTY_PROPERTY_CLASS}) public class ClassModel { public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; private String propertyClass; - public ClassModel propertyClass(String propertyClass) { - + this.propertyClass = propertyClass; return this; } - /** + /** * Get propertyClass + * * @return propertyClass - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -78,7 +66,6 @@ public class ClassModel { return Objects.hash(propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,8 +76,7 @@ public class ClassModel { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -98,6 +84,4 @@ public class ClassModel { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java index 02b0aac224..8aeda7b92c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Client.java @@ -3,63 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Client - */ -@JsonPropertyOrder({ - Client.JSON_PROPERTY_CLIENT -}) - +/** Client */ +@JsonPropertyOrder({Client.JSON_PROPERTY_CLIENT}) public class Client { public static final String JSON_PROPERTY_CLIENT = "client"; private String client; - public Client client(String client) { - + this.client = client; return this; } - /** + /** * Get client + * * @return client - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CLIENT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,7 +64,6 @@ public class Client { return Objects.hash(client); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,8 +74,7 @@ public class Client { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -97,6 +82,4 @@ public class Client { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java index 78044654d5..7c8b535861 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Dog.java @@ -3,65 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Dog - */ -@JsonPropertyOrder({ - Dog.JSON_PROPERTY_BREED -}) - +/** Dog */ +@JsonPropertyOrder({Dog.JSON_PROPERTY_BREED}) public class Dog extends Animal { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; - public Dog breed(String breed) { - + this.breed = breed; return this; } - /** + /** * Get breed + * * @return breed - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -71,8 +56,7 @@ public class Dog extends Animal { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); + return Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override @@ -80,7 +64,6 @@ public class Dog extends Animal { return Objects.hash(breed, super.hashCode()); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -92,8 +75,7 @@ public class Dog extends Animal { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -101,6 +83,4 @@ public class Dog extends Animal { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java index dd42595cf2..d474f9b5b1 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -3,63 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * DogAllOf - */ -@JsonPropertyOrder({ - DogAllOf.JSON_PROPERTY_BREED -}) - +/** DogAllOf */ +@JsonPropertyOrder({DogAllOf.JSON_PROPERTY_BREED}) public class DogAllOf { public static final String JSON_PROPERTY_BREED = "breed"; private String breed; - public DogAllOf breed(String breed) { - + this.breed = breed; return this; } - /** + /** * Get breed + * * @return breed - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BREED) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,7 +64,6 @@ public class DogAllOf { return Objects.hash(breed); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,8 +74,7 @@ public class DogAllOf { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -97,6 +82,4 @@ public class DogAllOf { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java index aff182cd49..8e72331cc3 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -3,43 +3,32 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * EnumArrays - */ -@JsonPropertyOrder({ - EnumArrays.JSON_PROPERTY_JUST_SYMBOL, - EnumArrays.JSON_PROPERTY_ARRAY_ENUM -}) +import java.util.Objects; +/** EnumArrays */ +@JsonPropertyOrder({EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM}) public class EnumArrays { - /** - * Gets or Sets justSymbol - */ + /** Gets or Sets justSymbol */ public enum JustSymbolEnum { GREATER_THAN_OR_EQUAL_TO(">="), - + DOLLAR("$"); private String value; @@ -72,12 +61,10 @@ public class EnumArrays { public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; private JustSymbolEnum justSymbol; - /** - * Gets or Sets arrayEnum - */ + /** Gets or Sets arrayEnum */ public enum ArrayEnumEnum { FISH("fish"), - + CRAB("crab"); private String value; @@ -110,34 +97,31 @@ public class EnumArrays { public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; private List arrayEnum = null; - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - + this.justSymbol = justSymbol; return this; } - /** + /** * Get justSymbol + * * @return justSymbol - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - public EnumArrays arrayEnum(List arrayEnum) { - + this.arrayEnum = arrayEnum; return this; } @@ -150,25 +134,23 @@ public class EnumArrays { return this; } - /** + /** * Get arrayEnum + * * @return arrayEnum - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -178,8 +160,8 @@ public class EnumArrays { return false; } EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return Objects.equals(this.justSymbol, enumArrays.justSymbol) + && Objects.equals(this.arrayEnum, enumArrays.arrayEnum); } @Override @@ -187,7 +169,6 @@ public class EnumArrays { return Objects.hash(justSymbol, arrayEnum); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -199,8 +180,7 @@ public class EnumArrays { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -208,6 +188,4 @@ public class EnumArrays { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java index e9102d9742..f1f1c4348c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumClass.java @@ -3,32 +3,25 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets EnumClass - */ +/** Gets or Sets EnumClass */ public enum EnumClass { - _ABC("_abc"), - + _EFG("-efg"), - + _XYZ_("(xyz)"); private String value; @@ -57,4 +50,3 @@ public enum EnumClass { throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java index 51a1a645a1..f58b5a2d33 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/EnumTest.java @@ -3,47 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.OuterEnum; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; -/** - * EnumTest - */ +/** EnumTest */ @JsonPropertyOrder({ EnumTest.JSON_PROPERTY_ENUM_STRING, EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, EnumTest.JSON_PROPERTY_ENUM_INTEGER, EnumTest.JSON_PROPERTY_ENUM_NUMBER, - EnumTest.JSON_PROPERTY_OUTER_ENUM + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) - public class EnumTest { - /** - * Gets or Sets enumString - */ + /** Gets or Sets enumString */ public enum EnumStringEnum { UPPER("UPPER"), - + LOWER("lower"), - + EMPTY(""); private String value; @@ -76,14 +72,12 @@ public class EnumTest { public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; private EnumStringEnum enumString; - /** - * Gets or Sets enumStringRequired - */ + /** Gets or Sets enumStringRequired */ public enum EnumStringRequiredEnum { UPPER("UPPER"), - + LOWER("lower"), - + EMPTY(""); private String value; @@ -116,12 +110,10 @@ public class EnumTest { public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; private EnumStringRequiredEnum enumStringRequired; - /** - * Gets or Sets enumInteger - */ + /** Gets or Sets enumInteger */ public enum EnumIntegerEnum { NUMBER_1(1), - + NUMBER_MINUS_1(-1); private Integer value; @@ -154,12 +146,10 @@ public class EnumTest { public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; private EnumIntegerEnum enumInteger; - /** - * Gets or Sets enumNumber - */ + /** Gets or Sets enumNumber */ public enum EnumNumberEnum { NUMBER_1_DOT_1(1.1), - + NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -193,132 +183,213 @@ public class EnumTest { private EnumNumberEnum enumNumber; public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private OuterEnum outerEnum; + private JsonNullable outerEnum = JsonNullable.undefined(); + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + private OuterEnumInteger outerEnumInteger; + + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = + "outerEnumIntegerDefaultValue"; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = + OuterEnumIntegerDefaultValue.NUMBER_0; public EnumTest enumString(EnumStringEnum enumString) { - + this.enumString = enumString; return this; } - /** + /** * Get enumString + * * @return enumString - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - + this.enumStringRequired = enumStringRequired; return this; } - /** + /** * Get enumStringRequired + * * @return enumStringRequired - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public EnumStringRequiredEnum getEnumStringRequired() { return enumStringRequired; } - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { this.enumStringRequired = enumStringRequired; } - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - + this.enumInteger = enumInteger; return this; } - /** + /** * Get enumInteger + * * @return enumInteger - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - + this.enumNumber = enumNumber; return this; } - /** + /** * Get enumNumber + * * @return enumNumber - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - public EnumTest outerEnum(OuterEnum outerEnum) { - - this.outerEnum = outerEnum; + this.outerEnum = JsonNullable.of(outerEnum); + return this; } - /** + /** * Get outerEnum + * * @return outerEnum - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") + @JsonIgnore + public OuterEnum getOuterEnum() { + return outerEnum.orElse(null); + } + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OuterEnum getOuterEnum() { + public JsonNullable getOuterEnum_JsonNullable() { return outerEnum; } - - public void setOuterEnum(OuterEnum outerEnum) { + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { this.outerEnum = outerEnum; } + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + } + + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * + * @return outerEnumInteger + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * + * @return outerEnumDefaultValue + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTest outerEnumIntegerDefaultValue( + OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * + * @return outerEnumIntegerDefaultValue + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + public void setOuterEnumIntegerDefaultValue( + OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } @Override public boolean equals(java.lang.Object o) { @@ -329,19 +400,29 @@ public class EnumTest { 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); + return Objects.equals(this.enumString, enumTest.enumString) + && Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) + && Objects.equals(this.enumInteger, enumTest.enumInteger) + && Objects.equals(this.enumNumber, enumTest.enumNumber) + && Objects.equals(this.outerEnum, enumTest.outerEnum) + && Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) + && Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) + && Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return Objects.hash( + enumString, + enumStringRequired, + enumInteger, + enumNumber, + outerEnum, + outerEnumInteger, + outerEnumDefaultValue, + outerEnumIntegerDefaultValue); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -351,13 +432,19 @@ public class EnumTest { sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ") + .append(toIndentedString(outerEnumDefaultValue)) + .append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ") + .append(toIndentedString(outerEnumIntegerDefaultValue)) + .append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -365,6 +452,4 @@ public class EnumTest { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 8166597792..e596551a77 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -3,36 +3,28 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * FileSchemaTestClass - */ +/** FileSchemaTestClass */ @JsonPropertyOrder({ FileSchemaTestClass.JSON_PROPERTY_FILE, FileSchemaTestClass.JSON_PROPERTY_FILES }) - public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILE = "file"; private java.io.File file; @@ -40,34 +32,31 @@ public class FileSchemaTestClass { public static final String JSON_PROPERTY_FILES = "files"; private List files = null; - public FileSchemaTestClass file(java.io.File file) { - + this.file = file; return this; } - /** + /** * Get file + * * @return file - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FILE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public java.io.File getFile() { return file; } - public void setFile(java.io.File file) { this.file = file; } - public FileSchemaTestClass files(List files) { - + this.files = files; return this; } @@ -80,25 +69,23 @@ public class FileSchemaTestClass { return this; } - /** + /** * Get files + * * @return files - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FILES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFiles() { return files; } - public void setFiles(List files) { this.files = files; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +95,8 @@ public class FileSchemaTestClass { return false; } FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return Objects.equals(this.file, fileSchemaTestClass.file) + && Objects.equals(this.files, fileSchemaTestClass.files); } @Override @@ -117,7 +104,6 @@ public class FileSchemaTestClass { return Objects.hash(file, files); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -129,8 +115,7 @@ public class FileSchemaTestClass { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -138,6 +123,4 @@ public class FileSchemaTestClass { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Foo.java similarity index 53% rename from samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java rename to samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Foo.java index ed08025496..8dddfe49d0 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Foo.java @@ -3,65 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * AdditionalPropertiesString - */ -@JsonPropertyOrder({ - AdditionalPropertiesString.JSON_PROPERTY_NAME -}) +/** Foo */ +@JsonPropertyOrder({Foo.JSON_PROPERTY_BAR}) +public class Foo { + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar = "bar"; -public class AdditionalPropertiesString extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public Foo bar(String bar) { - - public AdditionalPropertiesString name(String name) { - - this.name = name; + this.bar = bar; return this; } - /** - * Get name - * @return name - **/ + /** + * Get bar + * + * @return bar + */ @javax.annotation.Nullable @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) + @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; + public String getBar() { + return bar; } - - public void setName(String name) { - this.name = name; + public void setBar(String bar) { + this.bar = bar; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,30 +55,26 @@ public class AdditionalPropertiesString extends HashMap { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(bar); } - @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("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -101,6 +82,4 @@ public class AdditionalPropertiesString extends HashMap { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java index 4dee7f6c9d..bbecfc0927 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/FormatTest.java @@ -3,34 +3,28 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Objects; import java.util.UUID; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -/** - * FormatTest - */ +/** FormatTest */ @JsonPropertyOrder({ FormatTest.JSON_PROPERTY_INTEGER, FormatTest.JSON_PROPERTY_INT32, @@ -45,9 +39,9 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; FormatTest.JSON_PROPERTY_DATE_TIME, FormatTest.JSON_PROPERTY_UUID, FormatTest.JSON_PROPERTY_PASSWORD, - FormatTest.JSON_PROPERTY_BIG_DECIMAL + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) - public class FormatTest { public static final String JSON_PROPERTY_INTEGER = "integer"; private Integer integer; @@ -88,365 +82,356 @@ public class FormatTest { 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_PATTERN_WITH_DIGITS = "pattern_with_digits"; + private String patternWithDigits; + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = + "pattern_with_digits_and_delimiter"; + private String patternWithDigitsAndDelimiter; public FormatTest integer(Integer integer) { - + this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 + /** + * Get integer minimum: 10 maximum: 100 + * * @return integer - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INTEGER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - public FormatTest int32(Integer int32) { - + this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 + /** + * Get int32 minimum: 20 maximum: 200 + * * @return int32 - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INT32) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - public FormatTest int64(Long int64) { - + this.int64 = int64; return this; } - /** + /** * Get int64 + * * @return int64 - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INT64) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - public FormatTest number(BigDecimal number) { - + this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 + /** + * Get number minimum: 32.1 maximum: 543.2 + * * @return number - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NUMBER) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - public FormatTest _float(Float _float) { - + this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 + /** + * Get _float minimum: 54.3 maximum: 987.6 + * * @return _float - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FLOAT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - public FormatTest _double(Double _double) { - + this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 + /** + * Get _double minimum: 67.8 maximum: 123.4 + * * @return _double - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DOUBLE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - public FormatTest string(String string) { - + this.string = string; return this; } - /** + /** * Get string + * * @return string - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getString() { return string; } - public void setString(String string) { this.string = string; } - public FormatTest _byte(byte[] _byte) { - + this._byte = _byte; return this; } - /** + /** * Get _byte + * * @return _byte - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_BYTE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public byte[] getByte() { return _byte; } - public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(File binary) { - + this.binary = binary; return this; } - /** + /** * Get binary + * * @return binary - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BINARY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public File getBinary() { return binary; } - public void setBinary(File binary) { this.binary = binary; } - public FormatTest date(LocalDate date) { - + this.date = date; return this; } - /** + /** * Get date + * * @return date - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_DATE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - public FormatTest dateTime(OffsetDateTime dateTime) { - + this.dateTime = dateTime; return this; } - /** + /** * Get dateTime + * * @return dateTime - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - public FormatTest uuid(UUID uuid) { - + this.uuid = uuid; return this; } - /** + /** * Get uuid + * * @return uuid - **/ + */ @javax.annotation.Nullable @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - public FormatTest password(String password) { - + this.password = password; return this; } - /** + /** * Get password + * * @return password - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } + public FormatTest patternWithDigits(String patternWithDigits) { - public FormatTest bigDecimal(BigDecimal bigDecimal) { - - this.bigDecimal = bigDecimal; + this.patternWithDigits = patternWithDigits; return this; } - /** - * Get bigDecimal - * @return bigDecimal - **/ + /** + * A string that is a 10 digit number. Can have leading zeros. + * + * @return patternWithDigits + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_BIG_DECIMAL) + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getBigDecimal() { - return bigDecimal; + public String getPatternWithDigits() { + return patternWithDigits; } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; } + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following + * i.e. Image_01. + * + * @return patternWithDigitsAndDelimiter + */ + @javax.annotation.Nullable + @ApiModelProperty( + value = + "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } @Override public boolean equals(java.lang.Object o) { @@ -457,28 +442,44 @@ public class FormatTest { 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); + return Objects.equals(this.integer, formatTest.integer) + && Objects.equals(this.int32, formatTest.int32) + && Objects.equals(this.int64, formatTest.int64) + && Objects.equals(this.number, formatTest.number) + && Objects.equals(this._float, formatTest._float) + && Objects.equals(this._double, formatTest._double) + && Objects.equals(this.string, formatTest.string) + && Arrays.equals(this._byte, formatTest._byte) + && Objects.equals(this.binary, formatTest.binary) + && Objects.equals(this.date, formatTest.date) + && Objects.equals(this.dateTime, formatTest.dateTime) + && Objects.equals(this.uuid, formatTest.uuid) + && Objects.equals(this.password, formatTest.password) + && Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) + && Objects.equals( + this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash( + integer, + int32, + int64, + number, + _float, + _double, + string, + Arrays.hashCode(_byte), + binary, + date, + dateTime, + uuid, + password, + patternWithDigits, + patternWithDigitsAndDelimiter); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -496,14 +497,16 @@ public class FormatTest { 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(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ") + .append(toIndentedString(patternWithDigitsAndDelimiter)) + .append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -511,6 +514,4 @@ public class FormatTest { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 0a3f0d4643..24bbe4252c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -3,34 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * HasOnlyReadOnly - */ -@JsonPropertyOrder({ - HasOnlyReadOnly.JSON_PROPERTY_BAR, - HasOnlyReadOnly.JSON_PROPERTY_FOO -}) - +/** HasOnlyReadOnly */ +@JsonPropertyOrder({HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO}) public class HasOnlyReadOnly { public static final String JSON_PROPERTY_BAR = "bar"; private String bar; @@ -38,39 +27,32 @@ public class HasOnlyReadOnly { public static final String JSON_PROPERTY_FOO = "foo"; private String foo; - - /** + /** * Get bar + * * @return bar - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } - - - - /** + /** * Get foo + * * @return foo - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FOO) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFoo() { return foo; } - - - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -80,8 +62,8 @@ public class HasOnlyReadOnly { return false; } HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return Objects.equals(this.bar, hasOnlyReadOnly.bar) + && Objects.equals(this.foo, hasOnlyReadOnly.foo); } @Override @@ -89,7 +71,6 @@ public class HasOnlyReadOnly { return Objects.hash(bar, foo); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -101,8 +82,7 @@ public class HasOnlyReadOnly { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -110,6 +90,4 @@ public class HasOnlyReadOnly { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HealthCheckResult.java new file mode 100644 index 0000000000..acaf6793dc --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer + * in generated model. + */ +@ApiModel( + description = + "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonPropertyOrder({HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE}) +public class HealthCheckResult { + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + private JsonNullable nullableMessage = JsonNullable.undefined(); + + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + + return this; + } + + /** + * Get nullableMessage + * + * @return nullableMessage + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public String getNullableMessage() { + return nullableMessage.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNullableMessage_JsonNullable() { + return nullableMessage; + } + + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject.java similarity index 59% rename from samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java rename to samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject.java index 0f1223c2bc..1141c66348 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject.java @@ -3,64 +3,75 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * AdditionalPropertiesAnyType - */ -@JsonPropertyOrder({ - AdditionalPropertiesAnyType.JSON_PROPERTY_NAME -}) - -public class AdditionalPropertiesAnyType extends HashMap { +/** InlineObject */ +@JsonPropertyOrder({InlineObject.JSON_PROPERTY_NAME, InlineObject.JSON_PROPERTY_STATUS}) +public class InlineObject { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public InlineObject name(String name) { - public AdditionalPropertiesAnyType name(String name) { - this.name = name; return this; } - /** - * Get name + /** + * Updated name of the pet + * * @return name - **/ + */ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(value = "Updated name of the pet") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } - public void setName(String name) { this.name = name; } + public InlineObject status(String status) { + + this.status = status; + return this; + } + + /** + * Updated status of the pet + * + * @return status + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Updated status of the pet") + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } @Override public boolean equals(java.lang.Object o) { @@ -70,30 +81,28 @@ public class AdditionalPropertiesAnyType extends HashMap { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); + InlineObject inlineObject = (InlineObject) o; + return Objects.equals(this.name, inlineObject.name) + && Objects.equals(this.status, inlineObject.status); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(name, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("class InlineObject {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -101,6 +110,4 @@ public class AdditionalPropertiesAnyType extends HashMap { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject1.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject1.java new file mode 100644 index 0000000000..2bf1fade37 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject1.java @@ -0,0 +1,117 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.util.Objects; + +/** InlineObject1 */ +@JsonPropertyOrder({ + InlineObject1.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject1.JSON_PROPERTY_FILE +}) +public class InlineObject1 { + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + private String additionalMetadata; + + public static final String JSON_PROPERTY_FILE = "file"; + private File file; + + public InlineObject1 additionalMetadata(String additionalMetadata) { + + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * Additional data to pass to server + * + * @return additionalMetadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional data to pass to server") + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public InlineObject1 file(File file) { + + this.file = file; + return this; + } + + /** + * file to upload + * + * @return file + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "file to upload") + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getFile() { + return file; + } + + public void setFile(File file) { + this.file = file; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject1 inlineObject1 = (InlineObject1) o; + return Objects.equals(this.additionalMetadata, inlineObject1.additionalMetadata) + && Objects.equals(this.file, inlineObject1.file); + } + + @Override + public int hashCode() { + return Objects.hash(additionalMetadata, file); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject1 {\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject2.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject2.java new file mode 100644 index 0000000000..92639fccae --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject2.java @@ -0,0 +1,198 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** InlineObject2 */ +@JsonPropertyOrder({ + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING_ARRAY, + InlineObject2.JSON_PROPERTY_ENUM_FORM_STRING +}) +public class InlineObject2 { + /** Gets or Sets enumFormStringArray */ + public enum EnumFormStringArrayEnum { + GREATER_THAN(">"), + + DOLLAR("$"); + + private String value; + + EnumFormStringArrayEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumFormStringArrayEnum fromValue(String value) { + for (EnumFormStringArrayEnum b : EnumFormStringArrayEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_FORM_STRING_ARRAY = "enum_form_string_array"; + private List enumFormStringArray = null; + + /** Form parameter enum test (string) */ + public enum EnumFormStringEnum { + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private String value; + + EnumFormStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumFormStringEnum fromValue(String value) { + for (EnumFormStringEnum b : EnumFormStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ENUM_FORM_STRING = "enum_form_string"; + private EnumFormStringEnum enumFormString = EnumFormStringEnum._EFG; + + public InlineObject2 enumFormStringArray(List enumFormStringArray) { + + this.enumFormStringArray = enumFormStringArray; + return this; + } + + public InlineObject2 addEnumFormStringArrayItem(EnumFormStringArrayEnum enumFormStringArrayItem) { + if (this.enumFormStringArray == null) { + this.enumFormStringArray = new ArrayList(); + } + this.enumFormStringArray.add(enumFormStringArrayItem); + return this; + } + + /** + * Form parameter enum test (string array) + * + * @return enumFormStringArray + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Form parameter enum test (string array)") + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getEnumFormStringArray() { + return enumFormStringArray; + } + + public void setEnumFormStringArray(List enumFormStringArray) { + this.enumFormStringArray = enumFormStringArray; + } + + public InlineObject2 enumFormString(EnumFormStringEnum enumFormString) { + + this.enumFormString = enumFormString; + return this; + } + + /** + * Form parameter enum test (string) + * + * @return enumFormString + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Form parameter enum test (string)") + @JsonProperty(JSON_PROPERTY_ENUM_FORM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumFormStringEnum getEnumFormString() { + return enumFormString; + } + + public void setEnumFormString(EnumFormStringEnum enumFormString) { + this.enumFormString = enumFormString; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject2 inlineObject2 = (InlineObject2) o; + return Objects.equals(this.enumFormStringArray, inlineObject2.enumFormStringArray) + && Objects.equals(this.enumFormString, inlineObject2.enumFormString); + } + + @Override + public int hashCode() { + return Objects.hash(enumFormStringArray, enumFormString); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject2 {\n"); + sb.append(" enumFormStringArray: ") + .append(toIndentedString(enumFormStringArray)) + .append("\n"); + sb.append(" enumFormString: ").append(toIndentedString(enumFormString)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject3.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject3.java new file mode 100644 index 0000000000..e95a6cbf36 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject3.java @@ -0,0 +1,481 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.math.BigDecimal; +import java.util.Arrays; +import java.util.Objects; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; + +/** InlineObject3 */ +@JsonPropertyOrder({ + InlineObject3.JSON_PROPERTY_INTEGER, + InlineObject3.JSON_PROPERTY_INT32, + InlineObject3.JSON_PROPERTY_INT64, + InlineObject3.JSON_PROPERTY_NUMBER, + InlineObject3.JSON_PROPERTY_FLOAT, + InlineObject3.JSON_PROPERTY_DOUBLE, + InlineObject3.JSON_PROPERTY_STRING, + InlineObject3.JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER, + InlineObject3.JSON_PROPERTY_BYTE, + InlineObject3.JSON_PROPERTY_BINARY, + InlineObject3.JSON_PROPERTY_DATE, + InlineObject3.JSON_PROPERTY_DATE_TIME, + InlineObject3.JSON_PROPERTY_PASSWORD, + InlineObject3.JSON_PROPERTY_CALLBACK +}) +public class InlineObject3 { + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; + + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; + + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; + + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; + + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; + + public static final String JSON_PROPERTY_STRING = "string"; + private String string; + + public static final String JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER = "pattern_without_delimiter"; + private String patternWithoutDelimiter; + + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; + + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; + + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; + + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_CALLBACK = "callback"; + private String callback; + + public InlineObject3 integer(Integer integer) { + + this.integer = integer; + return this; + } + + /** + * None minimum: 10 maximum: 100 + * + * @return integer + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; + } + + public void setInteger(Integer integer) { + this.integer = integer; + } + + public InlineObject3 int32(Integer int32) { + + this.int32 = int32; + return this; + } + + /** + * None minimum: 20 maximum: 200 + * + * @return int32 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; + } + + public void setInt32(Integer int32) { + this.int32 = int32; + } + + public InlineObject3 int64(Long int64) { + + this.int64 = int64; + return this; + } + + /** + * None + * + * @return int64 + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; + } + + public void setInt64(Long int64) { + this.int64 = int64; + } + + public InlineObject3 number(BigDecimal number) { + + this.number = number; + return this; + } + + /** + * None minimum: 32.1 maximum: 543.2 + * + * @return number + */ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public InlineObject3 _float(Float _float) { + + this._float = _float; + return this; + } + + /** + * None maximum: 987.6 + * + * @return _float + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; + } + + public void setFloat(Float _float) { + this._float = _float; + } + + public InlineObject3 _double(Double _double) { + + this._double = _double; + return this; + } + + /** + * None minimum: 67.8 maximum: 123.4 + * + * @return _double + */ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getDouble() { + return _double; + } + + public void setDouble(Double _double) { + this._double = _double; + } + + public InlineObject3 string(String string) { + + this.string = string; + return this; + } + + /** + * None + * + * @return string + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + public void setString(String string) { + this.string = string; + } + + public InlineObject3 patternWithoutDelimiter(String patternWithoutDelimiter) { + + this.patternWithoutDelimiter = patternWithoutDelimiter; + return this; + } + + /** + * None + * + * @return patternWithoutDelimiter + */ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_PATTERN_WITHOUT_DELIMITER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPatternWithoutDelimiter() { + return patternWithoutDelimiter; + } + + public void setPatternWithoutDelimiter(String patternWithoutDelimiter) { + this.patternWithoutDelimiter = patternWithoutDelimiter; + } + + public InlineObject3 _byte(byte[] _byte) { + + this._byte = _byte; + return this; + } + + /** + * None + * + * @return _byte + */ + @ApiModelProperty(required = true, value = "None") + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public InlineObject3 binary(File binary) { + + this.binary = binary; + return this; + } + + /** + * None + * + * @return binary + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + public void setBinary(File binary) { + this.binary = binary; + } + + public InlineObject3 date(LocalDate date) { + + this.date = date; + return this; + } + + /** + * None + * + * @return date + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public InlineObject3 dateTime(OffsetDateTime dateTime) { + + this.dateTime = dateTime; + return this; + } + + /** + * None + * + * @return dateTime + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public InlineObject3 password(String password) { + + this.password = password; + return this; + } + + /** + * None + * + * @return password + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public InlineObject3 callback(String callback) { + + this.callback = callback; + return this; + } + + /** + * None + * + * @return callback + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "None") + @JsonProperty(JSON_PROPERTY_CALLBACK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCallback() { + return callback; + } + + public void setCallback(String callback) { + this.callback = callback; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject3 inlineObject3 = (InlineObject3) o; + return Objects.equals(this.integer, inlineObject3.integer) + && Objects.equals(this.int32, inlineObject3.int32) + && Objects.equals(this.int64, inlineObject3.int64) + && Objects.equals(this.number, inlineObject3.number) + && Objects.equals(this._float, inlineObject3._float) + && Objects.equals(this._double, inlineObject3._double) + && Objects.equals(this.string, inlineObject3.string) + && Objects.equals(this.patternWithoutDelimiter, inlineObject3.patternWithoutDelimiter) + && Arrays.equals(this._byte, inlineObject3._byte) + && Objects.equals(this.binary, inlineObject3.binary) + && Objects.equals(this.date, inlineObject3.date) + && Objects.equals(this.dateTime, inlineObject3.dateTime) + && Objects.equals(this.password, inlineObject3.password) + && Objects.equals(this.callback, inlineObject3.callback); + } + + @Override + public int hashCode() { + return Objects.hash( + integer, + int32, + int64, + number, + _float, + _double, + string, + patternWithoutDelimiter, + Arrays.hashCode(_byte), + binary, + date, + dateTime, + password, + callback); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject3 {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" patternWithoutDelimiter: ") + .append(toIndentedString(patternWithoutDelimiter)) + .append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" callback: ").append(toIndentedString(callback)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject4.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject4.java new file mode 100644 index 0000000000..8704fc9a4b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject4.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; + +/** InlineObject4 */ +@JsonPropertyOrder({InlineObject4.JSON_PROPERTY_PARAM, InlineObject4.JSON_PROPERTY_PARAM2}) +public class InlineObject4 { + public static final String JSON_PROPERTY_PARAM = "param"; + private String param; + + public static final String JSON_PROPERTY_PARAM2 = "param2"; + private String param2; + + public InlineObject4 param(String param) { + + this.param = param; + return this; + } + + /** + * field1 + * + * @return param + */ + @ApiModelProperty(required = true, value = "field1") + @JsonProperty(JSON_PROPERTY_PARAM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParam() { + return param; + } + + public void setParam(String param) { + this.param = param; + } + + public InlineObject4 param2(String param2) { + + this.param2 = param2; + return this; + } + + /** + * field2 + * + * @return param2 + */ + @ApiModelProperty(required = true, value = "field2") + @JsonProperty(JSON_PROPERTY_PARAM2) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getParam2() { + return param2; + } + + public void setParam2(String param2) { + this.param2 = param2; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject4 inlineObject4 = (InlineObject4) o; + return Objects.equals(this.param, inlineObject4.param) + && Objects.equals(this.param2, inlineObject4.param2); + } + + @Override + public int hashCode() { + return Objects.hash(param, param2); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject4 {\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" param2: ").append(toIndentedString(param2)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject5.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject5.java new file mode 100644 index 0000000000..d5426d00c1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineObject5.java @@ -0,0 +1,116 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.io.File; +import java.util.Objects; + +/** InlineObject5 */ +@JsonPropertyOrder({ + InlineObject5.JSON_PROPERTY_ADDITIONAL_METADATA, + InlineObject5.JSON_PROPERTY_REQUIRED_FILE +}) +public class InlineObject5 { + public static final String JSON_PROPERTY_ADDITIONAL_METADATA = "additionalMetadata"; + private String additionalMetadata; + + public static final String JSON_PROPERTY_REQUIRED_FILE = "requiredFile"; + private File requiredFile; + + public InlineObject5 additionalMetadata(String additionalMetadata) { + + this.additionalMetadata = additionalMetadata; + return this; + } + + /** + * Additional data to pass to server + * + * @return additionalMetadata + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "Additional data to pass to server") + @JsonProperty(JSON_PROPERTY_ADDITIONAL_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAdditionalMetadata() { + return additionalMetadata; + } + + public void setAdditionalMetadata(String additionalMetadata) { + this.additionalMetadata = additionalMetadata; + } + + public InlineObject5 requiredFile(File requiredFile) { + + this.requiredFile = requiredFile; + return this; + } + + /** + * file to upload + * + * @return requiredFile + */ + @ApiModelProperty(required = true, value = "file to upload") + @JsonProperty(JSON_PROPERTY_REQUIRED_FILE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public File getRequiredFile() { + return requiredFile; + } + + public void setRequiredFile(File requiredFile) { + this.requiredFile = requiredFile; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineObject5 inlineObject5 = (InlineObject5) o; + return Objects.equals(this.additionalMetadata, inlineObject5.additionalMetadata) + && Objects.equals(this.requiredFile, inlineObject5.requiredFile); + } + + @Override + public int hashCode() { + return Objects.hash(additionalMetadata, requiredFile); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineObject5 {\n"); + sb.append(" additionalMetadata: ").append(toIndentedString(additionalMetadata)).append("\n"); + sb.append(" requiredFile: ").append(toIndentedString(requiredFile)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineResponseDefault.java similarity index 53% rename from samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java rename to samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 5e46887031..f9e010ddc7 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -3,65 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * AdditionalPropertiesObject - */ -@JsonPropertyOrder({ - AdditionalPropertiesObject.JSON_PROPERTY_NAME -}) +/** InlineResponseDefault */ +@JsonPropertyOrder({InlineResponseDefault.JSON_PROPERTY_STRING}) +public class InlineResponseDefault { + public static final String JSON_PROPERTY_STRING = "string"; + private Foo string; -public class AdditionalPropertiesObject extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public InlineResponseDefault string(Foo string) { - - public AdditionalPropertiesObject name(String name) { - - this.name = name; + this.string = string; return this; } - /** - * Get name - * @return name - **/ + /** + * Get string + * + * @return string + */ @javax.annotation.Nullable @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME) + @JsonProperty(JSON_PROPERTY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; + public Foo getString() { + return string; } - - public void setName(String name) { - this.name = name; + public void setString(Foo string) { + this.string = string; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,30 +55,26 @@ public class AdditionalPropertiesObject extends HashMap { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); + InlineResponseDefault inlineResponseDefault = (InlineResponseDefault) o; + return Objects.equals(this.string, inlineResponseDefault.string); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(string); } - @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("class InlineResponseDefault {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); sb.append("}"); return sb.toString(); } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -101,6 +82,4 @@ public class AdditionalPropertiesObject extends HashMap { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java index 113f92dd9c..d5d3dfe599 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MapTest.java @@ -3,49 +3,40 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.List; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * MapTest - */ +/** MapTest */ @JsonPropertyOrder({ MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, MapTest.JSON_PROPERTY_DIRECT_MAP, MapTest.JSON_PROPERTY_INDIRECT_MAP }) - public class MapTest { public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; private Map> mapMapOfString = null; - /** - * Gets or Sets inner - */ + /** Gets or Sets inner */ public enum InnerEnum { UPPER("UPPER"), - + LOWER("lower"); private String value; @@ -84,9 +75,8 @@ public class MapTest { public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; private Map indirectMap = null; - public MapTest mapMapOfString(Map> mapMapOfString) { - + this.mapMapOfString = mapMapOfString; return this; } @@ -99,27 +89,25 @@ public class MapTest { return this; } - /** + /** * Get mapMapOfString + * * @return mapMapOfString - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - public MapTest mapOfEnumString(Map mapOfEnumString) { - + this.mapOfEnumString = mapOfEnumString; return this; } @@ -132,27 +120,25 @@ public class MapTest { return this; } - /** + /** * Get mapOfEnumString + * * @return mapOfEnumString - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - public MapTest directMap(Map directMap) { - + this.directMap = directMap; return this; } @@ -165,27 +151,25 @@ public class MapTest { return this; } - /** + /** * Get directMap + * * @return directMap - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getDirectMap() { return directMap; } - public void setDirectMap(Map directMap) { this.directMap = directMap; } - public MapTest indirectMap(Map indirectMap) { - + this.indirectMap = indirectMap; return this; } @@ -198,25 +182,23 @@ public class MapTest { return this; } - /** + /** * Get indirectMap + * * @return indirectMap - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,10 +208,10 @@ public class MapTest { 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); + 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 @@ -237,7 +219,6 @@ public class MapTest { return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -251,8 +232,7 @@ public class MapTest { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -260,6 +240,4 @@ public class MapTest { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d483d69700..9a30d1299f 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -3,41 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; -import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; -import org.openapitools.client.model.Animal; import org.threeten.bp.OffsetDateTime; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ +/** MixedPropertiesAndAdditionalPropertiesClass */ @JsonPropertyOrder({ MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) - public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_UUID = "uuid"; private UUID uuid; @@ -48,59 +38,54 @@ public class MixedPropertiesAndAdditionalPropertiesClass { public static final String JSON_PROPERTY_MAP = "map"; private Map map = null; - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - + this.uuid = uuid; return this; } - /** + /** * Get uuid + * * @return uuid - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_UUID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - + this.dateTime = dateTime; return this; } - /** + /** * Get dateTime + * * @return dateTime - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_DATE_TIME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - + this.map = map; return this; } @@ -113,25 +98,23 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return this; } - /** + /** * Get map + * * @return map - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MAP) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -140,10 +123,11 @@ public class MixedPropertiesAndAdditionalPropertiesClass { 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); + MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = + (MixedPropertiesAndAdditionalPropertiesClass) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) + && Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) + && Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); } @Override @@ -151,7 +135,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return Objects.hash(uuid, dateTime, map); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -164,8 +147,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -173,6 +155,4 @@ public class MixedPropertiesAndAdditionalPropertiesClass { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java index dd99468a00..b3972c0603 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Model200Response.java @@ -3,35 +3,28 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Model for testing model name starting with number - */ +/** Model for testing model name starting with number */ @ApiModel(description = "Model for testing model name starting with number") @JsonPropertyOrder({ Model200Response.JSON_PROPERTY_NAME, Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) - public class Model200Response { public static final String JSON_PROPERTY_NAME = "name"; private Integer name; @@ -39,57 +32,52 @@ public class Model200Response { public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; private String propertyClass; - public Model200Response name(Integer name) { - + this.name = name; return this; } - /** + /** * Get name + * * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - public Model200Response propertyClass(String propertyClass) { - + this.propertyClass = propertyClass; return this; } - /** + /** * Get propertyClass + * * @return propertyClass - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -99,8 +87,8 @@ public class Model200Response { return false; } Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return Objects.equals(this.name, _200response.name) + && Objects.equals(this.propertyClass, _200response.propertyClass); } @Override @@ -108,7 +96,6 @@ public class Model200Response { return Objects.hash(name, propertyClass); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -120,8 +107,7 @@ public class Model200Response { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -129,6 +115,4 @@ public class Model200Response { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 383cafdd3a..2efca6f97b 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -3,35 +3,27 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * ModelApiResponse - */ +/** ModelApiResponse */ @JsonPropertyOrder({ ModelApiResponse.JSON_PROPERTY_CODE, ModelApiResponse.JSON_PROPERTY_TYPE, ModelApiResponse.JSON_PROPERTY_MESSAGE }) - public class ModelApiResponse { public static final String JSON_PROPERTY_CODE = "code"; private Integer code; @@ -42,82 +34,75 @@ public class ModelApiResponse { public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; - public ModelApiResponse code(Integer code) { - + this.code = code; return this; } - /** + /** * Get code + * * @return code - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - public ModelApiResponse type(String type) { - + this.type = type; return this; } - /** + /** * Get type + * * @return type - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { return type; } - public void setType(String type) { this.type = type; } - public ModelApiResponse message(String message) { - + this.message = message; return this; } - /** + /** * Get message + * * @return message - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MESSAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -127,9 +112,9 @@ public class ModelApiResponse { 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); + return Objects.equals(this.code, _apiResponse.code) + && Objects.equals(this.type, _apiResponse.type) + && Objects.equals(this.message, _apiResponse.message); } @Override @@ -137,7 +122,6 @@ public class ModelApiResponse { return Objects.hash(code, type, message); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -150,8 +134,7 @@ public class ModelApiResponse { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -159,6 +142,4 @@ public class ModelApiResponse { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java index b62e13a90a..374989b521 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -3,64 +3,52 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Model for testing reserved words - */ +/** Model for testing reserved words */ @ApiModel(description = "Model for testing reserved words") -@JsonPropertyOrder({ - ModelReturn.JSON_PROPERTY_RETURN -}) - +@JsonPropertyOrder({ModelReturn.JSON_PROPERTY_RETURN}) public class ModelReturn { public static final String JSON_PROPERTY_RETURN = "return"; private Integer _return; - public ModelReturn _return(Integer _return) { - + this._return = _return; return this; } - /** + /** * Get _return + * * @return _return - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_RETURN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -78,7 +66,6 @@ public class ModelReturn { return Objects.hash(_return); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,8 +76,7 @@ public class ModelReturn { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -98,6 +84,4 @@ public class ModelReturn { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java index bd625c5f66..918eb738e2 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Name.java @@ -3,29 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Model for testing model name same as property name - */ +/** Model for testing model name same as property name */ @ApiModel(description = "Model for testing model name same as property name") @JsonPropertyOrder({ Name.JSON_PROPERTY_NAME, @@ -33,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Name.JSON_PROPERTY_PROPERTY, Name.JSON_PROPERTY_123NUMBER }) - public class Name { public static final String JSON_PROPERTY_NAME = "name"; private Integer name; @@ -47,88 +40,77 @@ public class Name { public static final String JSON_PROPERTY_123NUMBER = "123Number"; private Integer _123number; - public Name name(Integer name) { - + this.name = name; return this; } - /** + /** * Get name + * * @return name - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** + /** * Get snakeCase + * * @return snakeCase - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SNAKE_CASE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSnakeCase() { return snakeCase; } - - - public Name property(String property) { - + this.property = property; return this; } - /** + /** * Get property + * * @return property - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PROPERTY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** + /** * Get _123number + * * @return _123number - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_123NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get123number() { return _123number; } - - - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -138,10 +120,10 @@ public class Name { 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); + 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 @@ -149,7 +131,6 @@ public class Name { return Objects.hash(name, snakeCase, property, _123number); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,8 +144,7 @@ public class Name { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -172,6 +152,4 @@ public class Name { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NullableClass.java new file mode 100644 index 0000000000..1c74f6e215 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NullableClass.java @@ -0,0 +1,612 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; + +/** NullableClass */ +@JsonPropertyOrder({ + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE +}) +public class NullableClass extends HashMap { + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + private JsonNullable integerProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + private JsonNullable numberProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + private JsonNullable booleanProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + private JsonNullable stringProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + private JsonNullable dateProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + private JsonNullable datetimeProp = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = + "array_and_items_nullable_prop"; + private JsonNullable> arrayAndItemsNullableProp = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + private List arrayItemsNullable = null; + + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + private JsonNullable> objectNullableProp = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = + "object_and_items_nullable_prop"; + private JsonNullable> objectAndItemsNullableProp = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + private Map objectItemsNullable = null; + + public NullableClass integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + + return this; + } + + /** + * Get integerProp + * + * @return integerProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public Integer getIntegerProp() { + return integerProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIntegerProp_JsonNullable() { + return integerProp; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + public void setIntegerProp_JsonNullable(JsonNullable integerProp) { + this.integerProp = integerProp; + } + + public void setIntegerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + } + + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + + return this; + } + + /** + * Get numberProp + * + * @return numberProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public BigDecimal getNumberProp() { + return numberProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNumberProp_JsonNullable() { + return numberProp; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + public void setNumberProp_JsonNullable(JsonNullable numberProp) { + this.numberProp = numberProp; + } + + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + } + + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + + return this; + } + + /** + * Get booleanProp + * + * @return booleanProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public Boolean getBooleanProp() { + return booleanProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getBooleanProp_JsonNullable() { + return booleanProp; + } + + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } + + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + } + + public NullableClass stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + + return this; + } + + /** + * Get stringProp + * + * @return stringProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public String getStringProp() { + return stringProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getStringProp_JsonNullable() { + return stringProp; + } + + @JsonProperty(JSON_PROPERTY_STRING_PROP) + public void setStringProp_JsonNullable(JsonNullable stringProp) { + this.stringProp = stringProp; + } + + public void setStringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + } + + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + + return this; + } + + /** + * Get dateProp + * + * @return dateProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public LocalDate getDateProp() { + return dateProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDateProp_JsonNullable() { + return dateProp; + } + + @JsonProperty(JSON_PROPERTY_DATE_PROP) + public void setDateProp_JsonNullable(JsonNullable dateProp) { + this.dateProp = dateProp; + } + + public void setDateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + } + + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + + return this; + } + + /** + * Get datetimeProp + * + * @return datetimeProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public OffsetDateTime getDatetimeProp() { + return datetimeProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDatetimeProp_JsonNullable() { + return datetimeProp; + } + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.>of(new ArrayList()); + } + try { + this.arrayNullableProp.get().add(arrayNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayNullableProp + * + * @return arrayNullableProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public List getArrayNullableProp() { + return arrayNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getArrayNullableProp_JsonNullable() { + return arrayNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.>of(new ArrayList()); + } + try { + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayAndItemsNullableProp + * + * @return arrayAndItemsNullableProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { + return arrayAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + public void setArrayAndItemsNullableProp_JsonNullable( + JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + } + + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * + * @return arrayItemsNullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.>of(new HashMap()); + } + try { + this.objectNullableProp.get().put(key, objectNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectNullableProp + * + * @return objectNullableProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public Map getObjectNullableProp() { + return objectNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getObjectNullableProp_JsonNullable() { + return objectNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + public void setObjectNullableProp_JsonNullable( + JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + } + + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = + JsonNullable.>of(objectAndItemsNullableProp); + + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem( + String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = + JsonNullable.>of(new HashMap()); + } + try { + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectAndItemsNullableProp + * + * @return objectAndItemsNullableProp + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonIgnore + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { + return objectAndItemsNullableProp; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + public void setObjectAndItemsNullableProp_JsonNullable( + JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = + JsonNullable.>of(objectAndItemsNullableProp); + } + + public NullableClass objectItemsNullable(Map objectItemsNullable) { + + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * + * @return objectItemsNullable + */ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) + && Objects.equals(this.numberProp, nullableClass.numberProp) + && Objects.equals(this.booleanProp, nullableClass.booleanProp) + && Objects.equals(this.stringProp, nullableClass.stringProp) + && Objects.equals(this.dateProp, nullableClass.dateProp) + && Objects.equals(this.datetimeProp, nullableClass.datetimeProp) + && Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) + && Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) + && Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) + && Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) + && Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) + && Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash( + integerProp, + numberProp, + booleanProp, + stringProp, + dateProp, + datetimeProp, + arrayNullableProp, + arrayAndItemsNullableProp, + arrayItemsNullable, + objectNullableProp, + objectAndItemsNullableProp, + objectItemsNullable, + super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ") + .append(toIndentedString(arrayAndItemsNullableProp)) + .append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ") + .append(toIndentedString(objectAndItemsNullableProp)) + .append("\n"); + sb.append(" objectItemsNullable: ") + .append(toIndentedString(objectItemsNullable)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java index 5ca72a169f..04ea549f07 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -3,64 +3,51 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * NumberOnly - */ -@JsonPropertyOrder({ - NumberOnly.JSON_PROPERTY_JUST_NUMBER -}) +import java.util.Objects; +/** NumberOnly */ +@JsonPropertyOrder({NumberOnly.JSON_PROPERTY_JUST_NUMBER}) public class NumberOnly { public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; private BigDecimal justNumber; - public NumberOnly justNumber(BigDecimal justNumber) { - + this.justNumber = justNumber; return this; } - /** + /** * Get justNumber + * * @return justNumber - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_JUST_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -78,7 +65,6 @@ public class NumberOnly { return Objects.hash(justNumber); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,8 +75,7 @@ public class NumberOnly { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -98,6 +83,4 @@ public class NumberOnly { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java index 6e28163021..b78b7482b4 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Order.java @@ -3,30 +3,25 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; +import org.threeten.bp.OffsetDateTime; -/** - * Order - */ +/** Order */ @JsonPropertyOrder({ Order.JSON_PROPERTY_ID, Order.JSON_PROPERTY_PET_ID, @@ -35,7 +30,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Order.JSON_PROPERTY_STATUS, Order.JSON_PROPERTY_COMPLETE }) - public class Order { public static final String JSON_PROPERTY_ID = "id"; private Long id; @@ -49,14 +43,12 @@ public class Order { public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; private OffsetDateTime shipDate; - /** - * Order Status - */ + /** Order Status */ public enum StatusEnum { PLACED("placed"), - + APPROVED("approved"), - + DELIVERED("delivered"); private String value; @@ -92,157 +84,144 @@ public class Order { public static final String JSON_PROPERTY_COMPLETE = "complete"; private Boolean complete = false; - public Order id(Long id) { - + this.id = id; return this; } - /** + /** * Get id + * * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - public Order petId(Long petId) { - + this.petId = petId; return this; } - /** + /** * Get petId + * * @return petId - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PET_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - public Order quantity(Integer quantity) { - + this.quantity = quantity; return this; } - /** + /** * Get quantity + * * @return quantity - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_QUANTITY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - public Order shipDate(OffsetDateTime shipDate) { - + this.shipDate = shipDate; return this; } - /** + /** * Get shipDate + * * @return shipDate - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_SHIP_DATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - public Order status(StatusEnum status) { - + this.status = status; return this; } - /** + /** * Order Status + * * @return status - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "Order Status") @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - public Order complete(Boolean complete) { - + this.complete = complete; return this; } - /** + /** * Get complete + * * @return complete - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_COMPLETE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -252,12 +231,12 @@ public class Order { 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); + 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 @@ -265,7 +244,6 @@ public class Order { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -281,8 +259,7 @@ public class Order { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -290,6 +267,4 @@ public class Order { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java index d4d9ac6ba1..1fd74d7906 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -3,36 +3,28 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * OuterComposite - */ +/** OuterComposite */ @JsonPropertyOrder({ OuterComposite.JSON_PROPERTY_MY_NUMBER, OuterComposite.JSON_PROPERTY_MY_STRING, OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) - public class OuterComposite { public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; private BigDecimal myNumber; @@ -43,82 +35,75 @@ public class OuterComposite { public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; private Boolean myBoolean; - public OuterComposite myNumber(BigDecimal myNumber) { - + this.myNumber = myNumber; return this; } - /** + /** * Get myNumber + * * @return myNumber - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_NUMBER) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - public OuterComposite myString(String myString) { - + this.myString = myString; return this; } - /** + /** * Get myString + * * @return myString - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_STRING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - public OuterComposite myBoolean(Boolean myBoolean) { - + this.myBoolean = myBoolean; return this; } - /** + /** * Get myBoolean + * * @return myBoolean - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -128,9 +113,9 @@ public class OuterComposite { 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); + return Objects.equals(this.myNumber, outerComposite.myNumber) + && Objects.equals(this.myString, outerComposite.myString) + && Objects.equals(this.myBoolean, outerComposite.myBoolean); } @Override @@ -138,7 +123,6 @@ public class OuterComposite { return Objects.hash(myNumber, myString, myBoolean); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -151,8 +135,7 @@ public class OuterComposite { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -160,6 +143,4 @@ public class OuterComposite { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java index 308646a320..6d7255bbe6 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -3,32 +3,25 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets OuterEnum - */ +/** Gets or Sets OuterEnum */ public enum OuterEnum { - PLACED("placed"), - + APPROVED("approved"), - + DELIVERED("delivered"); private String value; @@ -54,7 +47,6 @@ public enum OuterEnum { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java new file mode 100644 index 0000000000..109be68433 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Gets or Sets OuterEnumDefaultValue */ +public enum OuterEnumDefaultValue { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumInteger.java new file mode 100644 index 0000000000..277107e010 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Gets or Sets OuterEnumInteger */ +public enum OuterEnumInteger { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 0000000000..91c11e7b4a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,52 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** Gets or Sets OuterEnumIntegerDefaultValue */ +public enum OuterEnumIntegerDefaultValue { + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java index be74dd5ca0..7690da073c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Pet.java @@ -3,33 +3,26 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; -/** - * Pet - */ +/** Pet */ @JsonPropertyOrder({ Pet.JSON_PROPERTY_ID, Pet.JSON_PROPERTY_CATEGORY, @@ -38,7 +31,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; Pet.JSON_PROPERTY_TAGS, Pet.JSON_PROPERTY_STATUS }) - public class Pet { public static final String JSON_PROPERTY_ID = "id"; private Long id; @@ -55,14 +47,12 @@ public class Pet { public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; - /** - * pet status in the store - */ + /** pet status in the store */ public enum StatusEnum { AVAILABLE("available"), - + PENDING("pending"), - + SOLD("sold"); private String value; @@ -95,83 +85,76 @@ public class Pet { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; - public Pet id(Long id) { - + this.id = id; return this; } - /** + /** * Get id + * * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - public Pet category(Category category) { - + this.category = category; return this; } - /** + /** * Get category + * * @return category - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_CATEGORY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - public Pet name(String name) { - + this.name = name; return this; } - /** + /** * Get name + * * @return name - **/ + */ @ApiModelProperty(example = "doggie", required = true, value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - public void setName(String name) { this.name = name; } - public Pet photoUrls(List photoUrls) { - + this.photoUrls = photoUrls; return this; } @@ -181,26 +164,24 @@ public class Pet { return this; } - /** + /** * Get photoUrls + * * @return photoUrls - **/ + */ @ApiModelProperty(required = true, value = "") @JsonProperty(JSON_PROPERTY_PHOTO_URLS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - public Pet tags(List tags) { - + this.tags = tags; return this; } @@ -213,50 +194,46 @@ public class Pet { return this; } - /** + /** * Get tags + * * @return tags - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_TAGS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - public Pet status(StatusEnum status) { - + this.status = status; return this; } - /** + /** * pet status in the store + * * @return status - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "pet status in the store") @JsonProperty(JSON_PROPERTY_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -266,12 +243,12 @@ public class Pet { 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); + 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 @@ -279,7 +256,6 @@ public class Pet { return Objects.hash(id, category, name, photoUrls, tags, status); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -295,8 +271,7 @@ public class Pet { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -304,6 +279,4 @@ public class Pet { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index b3e58ef3d2..11ad89b4d0 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -3,34 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * ReadOnlyFirst - */ -@JsonPropertyOrder({ - ReadOnlyFirst.JSON_PROPERTY_BAR, - ReadOnlyFirst.JSON_PROPERTY_BAZ -}) - +/** ReadOnlyFirst */ +@JsonPropertyOrder({ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ}) public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAR = "bar"; private String bar; @@ -38,48 +27,42 @@ public class ReadOnlyFirst { public static final String JSON_PROPERTY_BAZ = "baz"; private String baz; - - /** + /** * Get bar + * * @return bar - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAR) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBar() { return bar; } - - - public ReadOnlyFirst baz(String baz) { - + this.baz = baz; return this; } - /** + /** * Get baz + * * @return baz - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_BAZ) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +72,8 @@ public class ReadOnlyFirst { return false; } ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return Objects.equals(this.bar, readOnlyFirst.bar) + && Objects.equals(this.baz, readOnlyFirst.baz); } @Override @@ -98,7 +81,6 @@ public class ReadOnlyFirst { return Objects.hash(bar, baz); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,8 +92,7 @@ public class ReadOnlyFirst { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -119,6 +100,4 @@ public class ReadOnlyFirst { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java index 35ad3bf469..2749ec0c7b 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -3,63 +3,50 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * SpecialModelName - */ -@JsonPropertyOrder({ - SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME -}) - +/** SpecialModelName */ +@JsonPropertyOrder({SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME}) public class SpecialModelName { public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; private Long $specialPropertyName; - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - + this.$specialPropertyName = $specialPropertyName; return this; } - /** + /** * Get $specialPropertyName + * * @return $specialPropertyName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long get$SpecialPropertyName() { return $specialPropertyName; } - public void set$SpecialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -68,8 +55,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override @@ -77,19 +64,19 @@ public class SpecialModelName { 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(" $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). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -97,6 +84,4 @@ public class SpecialModelName { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java index a3ecb398fa..f2155a9a7e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/Tag.java @@ -3,34 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * Tag - */ -@JsonPropertyOrder({ - Tag.JSON_PROPERTY_ID, - Tag.JSON_PROPERTY_NAME -}) - +/** Tag */ +@JsonPropertyOrder({Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME}) public class Tag { public static final String JSON_PROPERTY_ID = "id"; private Long id; @@ -38,57 +27,52 @@ public class Tag { public static final String JSON_PROPERTY_NAME = "name"; private String name; - public Tag id(Long id) { - + this.id = id; return this; } - /** + /** * Get id + * * @return id - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - public Tag name(String name) { - + this.name = name; return this; } - /** + /** * Get name + * * @return name - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } - public void setName(String name) { this.name = name; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -98,8 +82,7 @@ public class Tag { return false; } Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return Objects.equals(this.id, tag.id) && Objects.equals(this.name, tag.name); } @Override @@ -107,7 +90,6 @@ public class Tag { return Objects.hash(id, name); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -119,8 +101,7 @@ public class Tag { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -128,6 +109,4 @@ public class Tag { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java deleted file mode 100644 index 73f3935879..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * TypeHolderDefault - */ -@JsonPropertyOrder({ - TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, - TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, - TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, - TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, - TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM -}) - -public class TypeHolderDefault { - 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_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_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList(); - - - public TypeHolderDefault stringItem(String stringItem) { - - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getStringItem() { - return stringItem; - } - - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getNumberItem() { - return numberItem; - } - - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderDefault integerItem(Integer integerItem) { - - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getIntegerItem() { - return integerItem; - } - - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderDefault boolItem(Boolean boolItem) { - - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getBoolItem() { - return boolItem; - } - - - 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 - **/ - @ApiModelProperty(required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getArrayItem() { - return arrayItem; - } - - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - @Override - public boolean equals(java.lang.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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java deleted file mode 100644 index e3daa1a3e1..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * TypeHolderExample - */ -@JsonPropertyOrder({ - TypeHolderExample.JSON_PROPERTY_STRING_ITEM, - TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, - TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, - TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, - TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, - TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM -}) - -public class TypeHolderExample { - 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_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_BOOL_ITEM = "bool_item"; - private Boolean boolItem; - - 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 - **/ - @ApiModelProperty(example = "what", required = true, value = "") - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getStringItem() { - return stringItem; - } - - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderExample numberItem(BigDecimal numberItem) { - - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getNumberItem() { - return numberItem; - } - - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderExample floatItem(Float floatItem) { - - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - **/ - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Float getFloatItem() { - return floatItem; - } - - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - - public TypeHolderExample integerItem(Integer integerItem) { - - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @ApiModelProperty(example = "-2", required = true, value = "") - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getIntegerItem() { - return integerItem; - } - - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderExample boolItem(Boolean boolItem) { - - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @ApiModelProperty(example = "true", required = true, value = "") - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getBoolItem() { - return boolItem; - } - - - 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 - **/ - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getArrayItem() { - return arrayItem; - } - - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - @Override - public boolean equals(java.lang.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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java index b7e74643da..637c962565 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/User.java @@ -3,29 +3,22 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import io.swagger.annotations.ApiModelProperty; +import java.util.Objects; -/** - * User - */ +/** User */ @JsonPropertyOrder({ User.JSON_PROPERTY_ID, User.JSON_PROPERTY_USERNAME, @@ -36,7 +29,6 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; User.JSON_PROPERTY_PHONE, User.JSON_PROPERTY_USER_STATUS }) - public class User { public static final String JSON_PROPERTY_ID = "id"; private Long id; @@ -62,207 +54,190 @@ public class User { 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 - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - public User username(String username) { - + this.username = username; return this; } - /** + /** * Get username + * * @return username - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_USERNAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - public User firstName(String firstName) { - + this.firstName = firstName; return this; } - /** + /** * Get firstName + * * @return firstName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_FIRST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - public User lastName(String lastName) { - + this.lastName = lastName; return this; } - /** + /** * Get lastName + * * @return lastName - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_LAST_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - public User email(String email) { - + this.email = email; return this; } - /** + /** * Get email + * * @return email - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_EMAIL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - public User password(String password) { - + this.password = password; return this; } - /** + /** * Get password + * * @return password - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PASSWORD) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - public User phone(String phone) { - + this.phone = phone; return this; } - /** + /** * Get phone + * * @return phone - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "") @JsonProperty(JSON_PROPERTY_PHONE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - public User userStatus(Integer userStatus) { - + this.userStatus = userStatus; return this; } - /** + /** * User Status + * * @return userStatus - **/ + */ @javax.annotation.Nullable @ApiModelProperty(value = "User Status") @JsonProperty(JSON_PROPERTY_USER_STATUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -272,14 +247,14 @@ public class User { 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); + 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 @@ -287,7 +262,6 @@ public class User { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -305,8 +279,7 @@ public class User { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { @@ -314,6 +287,4 @@ public class User { } return o.toString().replace("\n", "\n "); } - } - diff --git a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java deleted file mode 100644 index f585a62522..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/main/java/org/openapitools/client/model/XmlItem.java +++ /dev/null @@ -1,1045 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import java.util.Objects; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * XmlItem - */ -@JsonPropertyOrder({ - XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, - XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, - XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, - XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, - XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_NAME_STRING, - XmlItem.JSON_PROPERTY_NAME_NUMBER, - XmlItem.JSON_PROPERTY_NAME_INTEGER, - XmlItem.JSON_PROPERTY_NAME_BOOLEAN, - XmlItem.JSON_PROPERTY_NAME_ARRAY, - XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_STRING, - XmlItem.JSON_PROPERTY_PREFIX_NUMBER, - XmlItem.JSON_PROPERTY_PREFIX_INTEGER, - XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, - XmlItem.JSON_PROPERTY_PREFIX_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_NAMESPACE_STRING, - XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, - XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, - XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, - XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, - XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, - XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, - XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, - XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, - XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY -}) - -public class XmlItem { - 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_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_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_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_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_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_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_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_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_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_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_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_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_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_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = null; - - - public XmlItem attributeString(String attributeString) { - - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getAttributeString() { - return attributeString; - } - - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - - public XmlItem attributeInteger(Integer attributeInteger) { - - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getAttributeInteger() { - return attributeInteger; - } - - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWrappedArray() { - return wrappedArray; - } - - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - - public XmlItem nameString(String nameString) { - - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNameString() { - return nameString; - } - - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - - public XmlItem nameNumber(BigDecimal nameNumber) { - - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getNameNumber() { - return nameNumber; - } - - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - - public XmlItem nameInteger(Integer nameInteger) { - - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNameInteger() { - return nameInteger; - } - - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - - public XmlItem nameBoolean(Boolean nameBoolean) { - - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getNameBoolean() { - return nameBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNameArray() { - return nameArray; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNameWrappedArray() { - return nameWrappedArray; - } - - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - - public XmlItem prefixString(String prefixString) { - - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrefixString() { - return prefixString; - } - - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - - public XmlItem prefixInteger(Integer prefixInteger) { - - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPrefixInteger() { - return prefixInteger; - } - - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixArray() { - return prefixArray; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - - public XmlItem namespaceString(String namespaceString) { - - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNamespaceString() { - return namespaceString; - } - - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - - public XmlItem namespaceInteger(Integer namespaceInteger) { - - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNamespaceArray() { - return namespaceArray; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - - public XmlItem prefixNsString(String prefixNsString) { - - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "string", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrefixNsString() { - return prefixNsString; - } - - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "-2", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixNsArray() { - return prefixNsArray; - } - - - 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 - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - - @Override - public boolean equals(java.lang.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(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index 837b5ea024..720c6161e9 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -3,48 +3,34 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Client; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for AnotherFakeApi - */ -@Ignore +/** API tests for AnotherFakeApi */ public class AnotherFakeApiTest { - private final AnotherFakeApi api = new AnotherFakeApi(); + private final AnotherFakeApi api = new AnotherFakeApi(); - - /** - * To test special tags - * - * To test special tags and operation ID starting with number - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void call123testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.call123testSpecialTags(body); - // TODO: test validations - } - + /** + * To test special tags + * + *

        To test special tags and operation ID starting with number + * + * @throws ApiException if the Api call fails + */ + @Test + public void call123testSpecialTagsTest() throws ApiException { + // Client client = null; + // Client response = api.call123testSpecialTags(client); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/DefaultApiTest.java new file mode 100644 index 0000000000..d3eccc34d9 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -0,0 +1,29 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.api; + +import org.junit.Test; +import org.openapitools.client.ApiException; + +/** API tests for DefaultApi */ +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** @throws ApiException if the Api call fails */ + @Test + public void fooGetTest() throws ApiException { + // InlineResponseDefault response = api.fooGet(); + // TODO: test validations + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java index b2c8f47fb3..6426c753ca 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -3,289 +3,280 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import java.math.BigDecimal; -import org.openapitools.client.model.Client; -import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.User; -import org.openapitools.client.model.XmlItem; -import org.junit.Test; +import java.io.ByteArrayInputStream; +import java.security.PrivateKey; +import java.util.Arrays; import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.auth.HttpSignatureAuth; +import org.openapitools.client.model.Pet; +import org.tomitribe.auth.signatures.*; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeApi - */ -@Ignore +/** API tests for FakeApi */ public class FakeApiTest { - private final FakeApi api = new FakeApi(); + private final FakeApi api = new FakeApi(); - - /** - * creates an XmlItem - * - * this route creates an XmlItem - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createXmlItemTest() throws ApiException { - XmlItem xmlItem = null; - api.createXmlItem(xmlItem); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer boolean types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); - // TODO: test validations - } - - /** - * - * - * Test serialization of object with outer number type - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer number types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterNumberSerializeTest() throws ApiException { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body); - // TODO: test validations - } - - /** - * - * - * Test serialization of outer string types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterStringSerializeTest() throws ApiException { - String body = null; - String response = api.fakeOuterStringSerialize(body); - // TODO: test validations - } - - /** - * - * - * For this test, the body for this request much reference a schema named `File`. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testBodyWithFileSchemaTest() throws ApiException { - FileSchemaTestClass body = null; - api.testBodyWithFileSchema(body); - // TODO: test validations - } - - /** - * - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testBodyWithQueryParamsTest() throws ApiException { - String query = null; - User body = null; - api.testBodyWithQueryParams(query, body); - // TODO: test validations - } - - /** - * To test \"client\" model - * - * To test \"client\" model - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); - // TODO: test validations - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - File binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - // TODO: test validations - } - - /** - * To test enum parameters - * - * To test enum parameters - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEnumParametersTest() throws ApiException { - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - List enumFormStringArray = null; - String enumFormString = null; - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - // TODO: test validations - } - - /** - * Fake endpoint to test group parameters (optional) - * - * Fake endpoint to test group parameters (optional) - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testGroupParametersTest() throws ApiException { - Integer requiredStringGroup = null; - Boolean requiredBooleanGroup = null; - Long requiredInt64Group = null; - Integer stringGroup = null; - Boolean booleanGroup = null; - Long int64Group = null; - api.testGroupParameters() - .requiredStringGroup(requiredStringGroup) - .requiredBooleanGroup(requiredBooleanGroup) - .requiredInt64Group(requiredInt64Group) - .stringGroup(stringGroup) - .booleanGroup(booleanGroup) - .int64Group(int64Group) - .execute(); - // TODO: test validations - } - - /** - * test inline additionalProperties - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testInlineAdditionalPropertiesTest() throws ApiException { - Map param = null; - api.testInlineAdditionalProperties(param); - // TODO: test validations - } - - /** - * test json serialization of form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); - // TODO: test validations - } - - /** - * - * - * To test the collection format in query parameters - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testQueryParameterCollectionFormatTest() throws ApiException { - List pipe = null; - List ioutil = null; - List http = null; - List url = null; - List context = null; - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - // TODO: test validations - } - + /** + * Health check endpoint + * + * @throws ApiException if the Api call fails + */ + @Test + public void fakeHealthGetTest() throws ApiException { + // HealthCheckResult response = api.fakeHealthGet(); + // TODO: test validations + } + + /** + * test http signature authentication + * + * @throws Exception if the Api call fails + */ + @Ignore + @Test + public void fakeHttpSignatureTestTest() throws Exception { + + final String privateKeyPem = + "-----BEGIN RSA PRIVATE KEY-----\n" + + "MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF\n" + + "NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F\n" + + "UR45uBJeDK1HSFHD8bH KD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB\n" + + "AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA\n" + + "QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK\n" + + "kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg\n" + + "f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u\n" + + "412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc\n" + + "mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7\n" + + "kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA\n" + + "gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW\n" + + "G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI\n" + + "7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==\n" + + "-----END RSA PRIVATE KEY-----\n"; + + PrivateKey privateKey = PEM.readPrivateKey(new ByteArrayInputStream(privateKeyPem.getBytes())); + ApiClient client = api.getApiClient(); + HttpSignatureAuth auth = (HttpSignatureAuth) client.getAuthentication("http_signature_test"); + auth.setAlgorithm(Algorithm.RSA_SHA512); + auth.setHeaders(Arrays.asList("(request-target)", "host", "date")); + auth.setup(privateKey); + + Pet pet = new Pet(); + pet.setId(10l); + pet.setName("test http signature"); + String query1 = "hello world"; + String header1 = "empty header"; + api.fakeHttpSignatureTest(pet, query1, header1); + } + + /** + * Test serialization of outer boolean types + * + * @throws ApiException if the Api call fails + */ + @Test + public void fakeOuterBooleanSerializeTest() throws ApiException { + // Boolean body = null; + // Boolean response = api.fakeOuterBooleanSerialize(body); + // TODO: test validations + } + + /** + * Test serialization of object with outer number type + * + * @throws ApiException if the Api call fails + */ + @Test + public void fakeOuterCompositeSerializeTest() throws ApiException { + // OuterComposite outerComposite = null; + // OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + // TODO: test validations + } + + /** + * Test serialization of outer number types + * + * @throws ApiException if the Api call fails + */ + @Test + public void fakeOuterNumberSerializeTest() throws ApiException { + // BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); + // TODO: test validations + } + + /** + * Test serialization of outer string types + * + * @throws ApiException if the Api call fails + */ + @Test + public void fakeOuterStringSerializeTest() throws ApiException { + // String body = null; + // String response = api.fakeOuterStringSerialize(body); + // TODO: test validations + } + + /** + * For this test, the body for this request much reference a schema named `File`. + * + * @throws ApiException if the Api call fails + */ + @Test + public void testBodyWithFileSchemaTest() throws ApiException { + // FileSchemaTestClass fileSchemaTestClass = null; + // api.testBodyWithFileSchema(fileSchemaTestClass); + // TODO: test validations + } + + /** @throws ApiException if the Api call fails */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + // String query = null; + // User user = null; + // api.testBodyWithQueryParams(query, user); + // TODO: test validations + } + + /** + * To test \"client\" model + * + *

        To test \"client\" model + * + * @throws ApiException if the Api call fails + */ + @Test + public void testClientModelTest() throws ApiException { + // Client client = null; + // Client response = api.testClientModel(client); + // TODO: test validations + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + *

        Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @throws ApiException if the Api call fails + */ + @Test + public void testEndpointParametersTest() throws ApiException { + // BigDecimal number = null; + // Double _double = null; + // String patternWithoutDelimiter = null; + // byte[] _byte = null; + // Integer integer = null; + // Integer int32 = null; + // Long int64 = null; + // Float _float = null; + // String string = null; + // File binary = null; + // LocalDate date = null; + // OffsetDateTime dateTime = null; + // String password = null; + // String paramCallback = null; + // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, + // int64, _float, string, binary, date, dateTime, password, paramCallback); + // TODO: test validations + } + + /** + * To test enum parameters + * + *

        To test enum parameters + * + * @throws ApiException if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + // List enumHeaderStringArray = null; + // String enumHeaderString = null; + // List enumQueryStringArray = null; + // String enumQueryString = null; + // Integer enumQueryInteger = null; + // Double enumQueryDouble = null; + // List enumFormStringArray = null; + // String enumFormString = null; + // api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, + // enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); + // TODO: test validations + } + + /** + * Fake endpoint to test group parameters (optional) + * + *

        Fake endpoint to test group parameters (optional) + * + * @throws ApiException if the Api call fails + */ + @Test + public void testGroupParametersTest() throws ApiException { + // Integer requiredStringGroup = null; + // Boolean requiredBooleanGroup = null; + // Long requiredInt64Group = null; + // Integer stringGroup = null; + // Boolean booleanGroup = null; + // Long int64Group = null; + // api.testGroupParameters() + // .requiredStringGroup(requiredStringGroup) + // .requiredBooleanGroup(requiredBooleanGroup) + // .requiredInt64Group(requiredInt64Group) + // .stringGroup(stringGroup) + // .booleanGroup(booleanGroup) + // .int64Group(int64Group) + // .execute(); + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * @throws ApiException if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + // Map requestBody = null; + // api.testInlineAdditionalProperties(requestBody); + // TODO: test validations + } + + /** + * test json serialization of form data + * + * @throws ApiException if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + // String param = null; + // String param2 = null; + // api.testJsonFormData(param, param2); + // TODO: test validations + } + + /** + * To test the collection format in query parameters + * + * @throws ApiException if the Api call fails + */ + @Test + public void testQueryParameterCollectionFormatTest() throws ApiException { + // List pipe = null; + // List ioutil = null; + // List http = null; + // List url = null; + // List context = null; + // api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 7199931679..037e053f8b 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -3,48 +3,34 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Client; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeClassnameTags123Api - */ -@Ignore +/** API tests for FakeClassnameTags123Api */ public class FakeClassnameTags123ApiTest { - private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); + private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); - - /** - * To test class name in snake case - * - * To test class name in snake case - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); - // TODO: test validations - } - + /** + * To test class name in snake case + * + *

        To test class name in snake case + * + * @throws ApiException if the Api call fails + */ + @Test + public void testClassnameTest() throws ApiException { + // Client client = null; + // Client response = api.testClassname(client); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java index fd382967f1..3321098abd 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -3,177 +3,143 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import java.io.File; -import org.openapitools.client.model.ModelApiResponse; -import org.openapitools.client.model.Pet; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for PetApi - */ -@Ignore +/** API tests for PetApi */ public class PetApiTest { - private final PetApi api = new PetApi(); + private final PetApi api = new PetApi(); - - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); - // TODO: test validations - } - - /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deletePetTest() throws ApiException { - Long petId = null; - String apiKey = null; - api.deletePet(petId, apiKey); - // TODO: test validations - } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByStatusTest() throws ApiException { - List status = null; - List response = api.findPetsByStatus(status); - // TODO: test validations - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); - // TODO: test validations - } - - /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getPetByIdTest() throws ApiException { - Long petId = null; - Pet response = api.getPetById(petId); - // TODO: test validations - } - - /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); - // TODO: test validations - } - - /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetWithFormTest() throws ApiException { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status); - // TODO: test validations - } - - /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void uploadFileTest() throws ApiException { - Long petId = null; - String additionalMetadata = null; - File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - // TODO: test validations - } - - /** - * uploads an image (required) - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void uploadFileWithRequiredFileTest() throws ApiException { - Long petId = null; - File requiredFile = null; - String additionalMetadata = null; - ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - // TODO: test validations - } - + /** + * Add a new pet to the store + * + * @throws ApiException if the Api call fails + */ + @Test + public void addPetTest() throws ApiException { + // Pet pet = null; + // api.addPet(pet); + // TODO: test validations + } + + /** + * Deletes a pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void deletePetTest() throws ApiException { + // Long petId = null; + // String apiKey = null; + // api.deletePet(petId, apiKey); + // TODO: test validations + } + + /** + * Finds Pets by status + * + *

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

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

        Returns a single pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void getPetByIdTest() throws ApiException { + // Long petId = null; + // Pet response = api.getPetById(petId); + // TODO: test validations + } + + /** + * Update an existing pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePetTest() throws ApiException { + // Pet pet = null; + // api.updatePet(pet); + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * @throws ApiException if the Api call fails + */ + @Test + public void updatePetWithFormTest() throws ApiException { + // Long petId = null; + // String name = null; + // String status = null; + // api.updatePetWithForm(petId, name, status); + // TODO: test validations + } + + /** + * uploads an image + * + * @throws ApiException if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + // Long petId = null; + // String additionalMetadata = null; + // File file = null; + // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + // TODO: test validations + } + + /** + * uploads an image (required) + * + * @throws ApiException if the Api call fails + */ + @Test + public void uploadFileWithRequiredFileTest() throws ApiException { + // Long petId = null; + // File requiredFile = null; + // String additionalMetadata = null; + // ModelApiResponse response = api.uploadFileWithRequiredFile(petId, requiredFile, + // additionalMetadata); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java index cd36a70fec..fb025663bf 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -3,92 +3,75 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.Order; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for StoreApi - */ -@Ignore +/** API tests for StoreApi */ public class StoreApiTest { - private final StoreApi api = new StoreApi(); + private final StoreApi api = new StoreApi(); - - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteOrderTest() throws ApiException { - String orderId = null; - api.deleteOrder(orderId); - // TODO: test validations - } - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getInventoryTest() throws ApiException { - Map response = api.getInventory(); - // TODO: test validations - } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getOrderByIdTest() throws ApiException { - Long orderId = null; - Order response = api.getOrderById(orderId); - // TODO: test validations - } - - /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); - // TODO: test validations - } - + /** + * Delete purchase order by ID + * + *

        For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers + * will generate API errors + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteOrderTest() throws ApiException { + // String orderId = null; + // api.deleteOrder(orderId); + // TODO: test validations + } + + /** + * Returns pet inventories by status + * + *

        Returns a map of status codes to quantities + * + * @throws ApiException if the Api call fails + */ + @Test + public void getInventoryTest() throws ApiException { + // Map response = api.getInventory(); + // TODO: test validations + } + + /** + * Find purchase order by ID + * + *

        For valid response try integer IDs with value <= 5 or > 10. Other values will + * generated exceptions + * + * @throws ApiException if the Api call fails + */ + @Test + public void getOrderByIdTest() throws ApiException { + // Long orderId = null; + // Order response = api.getOrderById(orderId); + // TODO: test validations + } + + /** + * Place an order for a pet + * + * @throws ApiException if the Api call fails + */ + @Test + public void placeOrderTest() throws ApiException { + // Order order = null; + // Order response = api.placeOrder(order); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java index f7ef9050c9..741cb5ab8e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -3,154 +3,123 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import org.openapitools.client.model.User; import org.junit.Test; -import org.junit.Ignore; +import org.openapitools.client.ApiException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for UserApi - */ -@Ignore +/** API tests for UserApi */ public class UserApiTest { - private final UserApi api = new UserApi(); + private final UserApi api = new UserApi(); - - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); - // TODO: test validations - } - - /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteUserTest() throws ApiException { - String username = null; - api.deleteUser(username); - // TODO: test validations - } - - /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getUserByNameTest() throws ApiException { - String username = null; - User response = api.getUserByName(username); - // TODO: test validations - } - - /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void loginUserTest() throws ApiException { - String username = null; - String password = null; - String response = api.loginUser(username, password); - // TODO: test validations - } - - /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void logoutUserTest() throws ApiException { - api.logoutUser(); - // TODO: test validations - } - - /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updateUserTest() throws ApiException { - String username = null; - User body = null; - api.updateUser(username, body); - // TODO: test validations - } - + /** + * Create user + * + *

        This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUserTest() throws ApiException { + // User user = null; + // api.createUser(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithArrayInputTest() throws ApiException { + // List user = null; + // api.createUsersWithArrayInput(user); + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * @throws ApiException if the Api call fails + */ + @Test + public void createUsersWithListInputTest() throws ApiException { + // List user = null; + // api.createUsersWithListInput(user); + // TODO: test validations + } + + /** + * Delete user + * + *

        This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void deleteUserTest() throws ApiException { + // String username = null; + // api.deleteUser(username); + // TODO: test validations + } + + /** + * Get user by user name + * + * @throws ApiException if the Api call fails + */ + @Test + public void getUserByNameTest() throws ApiException { + // String username = null; + // User response = api.getUserByName(username); + // TODO: test validations + } + + /** + * Logs user into the system + * + * @throws ApiException if the Api call fails + */ + @Test + public void loginUserTest() throws ApiException { + // String username = null; + // String password = null; + // String response = api.loginUser(username, password); + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * @throws ApiException if the Api call fails + */ + @Test + public void logoutUserTest() throws ApiException { + // api.logoutUser(); + // TODO: test validations + } + + /** + * Updated user + * + *

        This can only be done by the logged in user. + * + * @throws ApiException if the Api call fails + */ + @Test + public void updateUserTest() throws ApiException { + // String username = null; + // User user = null; + // api.updateUser(username, user); + // TODO: test validations + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java deleted file mode 100644 index ec44af7838..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesAnyTypeTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesAnyType - */ -public class AdditionalPropertiesAnyTypeTest { - private final AdditionalPropertiesAnyType model = new AdditionalPropertiesAnyType(); - - /** - * Model tests for AdditionalPropertiesAnyType - */ - @Test - public void testAdditionalPropertiesAnyType() { - // TODO: test AdditionalPropertiesAnyType - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java deleted file mode 100644 index ceb024c562..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesArrayTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesArray - */ -public class AdditionalPropertiesArrayTest { - private final AdditionalPropertiesArray model = new AdditionalPropertiesArray(); - - /** - * Model tests for AdditionalPropertiesArray - */ - @Test - public void testAdditionalPropertiesArray() { - // TODO: test AdditionalPropertiesArray - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java deleted file mode 100644 index 517e5a10ae..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesBooleanTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesBoolean - */ -public class AdditionalPropertiesBooleanTest { - private final AdditionalPropertiesBoolean model = new AdditionalPropertiesBoolean(); - - /** - * Model tests for AdditionalPropertiesBoolean - */ - @Test - public void testAdditionalPropertiesBoolean() { - // TODO: test AdditionalPropertiesBoolean - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 2e3844ba97..b83e07ecea 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -3,131 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesClass - */ +/** Model tests for AdditionalPropertiesClass */ public class AdditionalPropertiesClassTest { - private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); + private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - /** - * Model tests for AdditionalPropertiesClass - */ - @Test - public void testAdditionalPropertiesClass() { - // TODO: test AdditionalPropertiesClass - } + /** Model tests for AdditionalPropertiesClass */ + @Test + public void testAdditionalPropertiesClass() { + // TODO: test AdditionalPropertiesClass + } - /** - * Test the property 'mapString' - */ - @Test - public void mapStringTest() { - // TODO: test mapString - } - - /** - * Test the property 'mapNumber' - */ - @Test - public void mapNumberTest() { - // TODO: test mapNumber - } - - /** - * Test the property 'mapInteger' - */ - @Test - public void mapIntegerTest() { - // TODO: test mapInteger - } - - /** - * Test the property 'mapBoolean' - */ - @Test - public void mapBooleanTest() { - // TODO: test mapBoolean - } - - /** - * Test the property 'mapArrayInteger' - */ - @Test - public void mapArrayIntegerTest() { - // TODO: test mapArrayInteger - } - - /** - * Test the property 'mapArrayAnytype' - */ - @Test - public void mapArrayAnytypeTest() { - // TODO: test mapArrayAnytype - } - - /** - * Test the property 'mapMapString' - */ - @Test - public void mapMapStringTest() { - // TODO: test mapMapString - } - - /** - * Test the property 'mapMapAnytype' - */ - @Test - public void mapMapAnytypeTest() { - // TODO: test mapMapAnytype - } - - /** - * Test the property 'anytype1' - */ - @Test - public void anytype1Test() { - // TODO: test anytype1 - } - - /** - * Test the property 'anytype2' - */ - @Test - public void anytype2Test() { - // TODO: test anytype2 - } - - /** - * Test the property 'anytype3' - */ - @Test - public void anytype3Test() { - // TODO: test anytype3 - } + /** Test the property 'mapProperty' */ + @Test + public void mapPropertyTest() { + // TODO: test mapProperty + } + /** Test the property 'mapOfMapProperty' */ + @Test + public void mapOfMapPropertyTest() { + // TODO: test mapOfMapProperty + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java deleted file mode 100644 index 66a7b85623..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesIntegerTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesInteger - */ -public class AdditionalPropertiesIntegerTest { - private final AdditionalPropertiesInteger model = new AdditionalPropertiesInteger(); - - /** - * Model tests for AdditionalPropertiesInteger - */ - @Test - public void testAdditionalPropertiesInteger() { - // TODO: test AdditionalPropertiesInteger - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java deleted file mode 100644 index 4e03485a44..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesNumberTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesNumber - */ -public class AdditionalPropertiesNumberTest { - private final AdditionalPropertiesNumber model = new AdditionalPropertiesNumber(); - - /** - * Model tests for AdditionalPropertiesNumber - */ - @Test - public void testAdditionalPropertiesNumber() { - // TODO: test AdditionalPropertiesNumber - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java deleted file mode 100644 index e0c72c5863..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesObjectTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesObject - */ -public class AdditionalPropertiesObjectTest { - private final AdditionalPropertiesObject model = new AdditionalPropertiesObject(); - - /** - * Model tests for AdditionalPropertiesObject - */ - @Test - public void testAdditionalPropertiesObject() { - // TODO: test AdditionalPropertiesObject - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java deleted file mode 100644 index c84d987e76..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AdditionalPropertiesStringTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for AdditionalPropertiesString - */ -public class AdditionalPropertiesStringTest { - private final AdditionalPropertiesString model = new AdditionalPropertiesString(); - - /** - * Model tests for AdditionalPropertiesString - */ - @Test - public void testAdditionalPropertiesString() { - // TODO: test AdditionalPropertiesString - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java index c0d10ec5a3..d0e9913bfa 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -3,57 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Animal - */ +/** Model tests for Animal */ public class AnimalTest { - private final Animal model = new Animal(); + private final Animal model = new Animal(); - /** - * Model tests for Animal - */ - @Test - public void testAnimal() { - // TODO: test Animal - } + /** Model tests for Animal */ + @Test + public void testAnimal() { + // TODO: test Animal + } - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } + /** Test the property 'className' */ + @Test + public void classNameTest() { + // TODO: test className + } + /** Test the property 'color' */ + @Test + public void colorTest() { + // TODO: test color + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index e25187a3b6..28f62e428d 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -3,50 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ArrayOfArrayOfNumberOnly - */ +/** Model tests for ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnlyTest { - private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); + private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ - @Test - public void testArrayOfArrayOfNumberOnly() { - // TODO: test ArrayOfArrayOfNumberOnly - } - - /** - * Test the property 'arrayArrayNumber' - */ - @Test - public void arrayArrayNumberTest() { - // TODO: test arrayArrayNumber - } + /** Model tests for ArrayOfArrayOfNumberOnly */ + @Test + public void testArrayOfArrayOfNumberOnly() { + // TODO: test ArrayOfArrayOfNumberOnly + } + /** Test the property 'arrayArrayNumber' */ + @Test + public void arrayArrayNumberTest() { + // TODO: test arrayArrayNumber + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index ae10618239..534bec6678 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -3,50 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ArrayOfNumberOnly - */ +/** Model tests for ArrayOfNumberOnly */ public class ArrayOfNumberOnlyTest { - private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); + private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); - /** - * Model tests for ArrayOfNumberOnly - */ - @Test - public void testArrayOfNumberOnly() { - // TODO: test ArrayOfNumberOnly - } - - /** - * Test the property 'arrayNumber' - */ - @Test - public void arrayNumberTest() { - // TODO: test arrayNumber - } + /** Model tests for ArrayOfNumberOnly */ + @Test + public void testArrayOfNumberOnly() { + // TODO: test ArrayOfNumberOnly + } + /** Test the property 'arrayNumber' */ + @Test + public void arrayNumberTest() { + // TODO: test arrayNumber + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 36bd9951cf..76ca006cd4 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -3,66 +3,42 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ArrayTest - */ +/** Model tests for ArrayTest */ public class ArrayTestTest { - private final ArrayTest model = new ArrayTest(); + private final ArrayTest model = new ArrayTest(); - /** - * Model tests for ArrayTest - */ - @Test - public void testArrayTest() { - // TODO: test ArrayTest - } + /** Model tests for ArrayTest */ + @Test + public void testArrayTest() { + // TODO: test ArrayTest + } - /** - * Test the property 'arrayOfString' - */ - @Test - public void arrayOfStringTest() { - // TODO: test arrayOfString - } + /** Test the property 'arrayOfString' */ + @Test + public void arrayOfStringTest() { + // TODO: test arrayOfString + } - /** - * Test the property 'arrayArrayOfInteger' - */ - @Test - public void arrayArrayOfIntegerTest() { - // TODO: test arrayArrayOfInteger - } - - /** - * Test the property 'arrayArrayOfModel' - */ - @Test - public void arrayArrayOfModelTest() { - // TODO: test arrayArrayOfModel - } + /** Test the property 'arrayArrayOfInteger' */ + @Test + public void arrayArrayOfIntegerTest() { + // TODO: test arrayArrayOfInteger + } + /** Test the property 'arrayArrayOfModel' */ + @Test + public void arrayArrayOfModelTest() { + // TODO: test arrayArrayOfModel + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java deleted file mode 100644 index a9b13011f0..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatAllOfTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for BigCatAllOf - */ -public class BigCatAllOfTest { - private final BigCatAllOf model = new BigCatAllOf(); - - /** - * Model tests for BigCatAllOf - */ - @Test - public void testBigCatAllOf() { - // TODO: test BigCatAllOf - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java deleted file mode 100644 index 006c807074..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/BigCatTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.BigCatAllOf; -import org.openapitools.client.model.Cat; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for BigCat - */ -public class BigCatTest { - private final BigCat model = new BigCat(); - - /** - * Model tests for BigCat - */ - @Test - public void testBigCat() { - // TODO: test BigCat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - - /** - * Test the property 'kind' - */ - @Test - public void kindTest() { - // TODO: test kind - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java index a701b341fc..dfe40524dc 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -3,87 +3,60 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Capitalization - */ +/** Model tests for Capitalization */ public class CapitalizationTest { - private final Capitalization model = new Capitalization(); + private final Capitalization model = new Capitalization(); - /** - * Model tests for Capitalization - */ - @Test - public void testCapitalization() { - // TODO: test Capitalization - } + /** Model tests for Capitalization */ + @Test + public void testCapitalization() { + // TODO: test Capitalization + } - /** - * Test the property 'smallCamel' - */ - @Test - public void smallCamelTest() { - // TODO: test smallCamel - } + /** Test the property 'smallCamel' */ + @Test + public void smallCamelTest() { + // TODO: test smallCamel + } - /** - * Test the property 'capitalCamel' - */ - @Test - public void capitalCamelTest() { - // TODO: test capitalCamel - } + /** Test the property 'capitalCamel' */ + @Test + public void capitalCamelTest() { + // TODO: test capitalCamel + } - /** - * Test the property 'smallSnake' - */ - @Test - public void smallSnakeTest() { - // TODO: test smallSnake - } + /** Test the property 'smallSnake' */ + @Test + public void smallSnakeTest() { + // TODO: test smallSnake + } - /** - * Test the property 'capitalSnake' - */ - @Test - public void capitalSnakeTest() { - // TODO: test capitalSnake - } + /** Test the property 'capitalSnake' */ + @Test + public void capitalSnakeTest() { + // TODO: test capitalSnake + } - /** - * Test the property 'scAETHFlowPoints' - */ - @Test - public void scAETHFlowPointsTest() { - // TODO: test scAETHFlowPoints - } - - /** - * Test the property 'ATT_NAME' - */ - @Test - public void ATT_NAMETest() { - // TODO: test ATT_NAME - } + /** Test the property 'scAETHFlowPoints' */ + @Test + public void scAETHFlowPointsTest() { + // TODO: test scAETHFlowPoints + } + /** Test the property 'ATT_NAME' */ + @Test + public void ATT_NAMETest() { + // TODO: test ATT_NAME + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java index 1d85a04472..ff21459308 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for CatAllOf - */ +/** Model tests for CatAllOf */ public class CatAllOfTest { - private final CatAllOf model = new CatAllOf(); + private final CatAllOf model = new CatAllOf(); - /** - * Model tests for CatAllOf - */ - @Test - public void testCatAllOf() { - // TODO: test CatAllOf - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } + /** Model tests for CatAllOf */ + @Test + public void testCatAllOf() { + // TODO: test CatAllOf + } + /** Test the property 'declawed' */ + @Test + public void declawedTest() { + // TODO: test declawed + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java index dbf40678a2..5cb2d0c25b 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CatTest.java @@ -3,65 +3,42 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.CatAllOf; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Cat - */ +/** Model tests for Cat */ public class CatTest { - private final Cat model = new Cat(); + private final Cat model = new Cat(); - /** - * Model tests for Cat - */ - @Test - public void testCat() { - // TODO: test Cat - } + /** Model tests for Cat */ + @Test + public void testCat() { + // TODO: test Cat + } - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } + /** Test the property 'className' */ + @Test + public void classNameTest() { + // TODO: test className + } - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } + /** Test the property 'color' */ + @Test + public void colorTest() { + // TODO: test color + } + /** Test the property 'declawed' */ + @Test + public void declawedTest() { + // TODO: test declawed + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java index 6027994a2a..3f1a86d0d6 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -3,55 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Category - */ +/** Model tests for Category */ public class CategoryTest { - private final Category model = new Category(); + private final Category model = new Category(); - /** - * Model tests for Category - */ - @Test - public void testCategory() { - // TODO: test Category - } + /** Model tests for Category */ + @Test + public void testCategory() { + // TODO: test Category + } - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java index 8914c9cad4..9c42158b17 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ClassModel - */ +/** Model tests for ClassModel */ public class ClassModelTest { - private final ClassModel model = new ClassModel(); + private final ClassModel model = new ClassModel(); - /** - * Model tests for ClassModel - */ - @Test - public void testClassModel() { - // TODO: test ClassModel - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } + /** Model tests for ClassModel */ + @Test + public void testClassModel() { + // TODO: test ClassModel + } + /** Test the property 'propertyClass' */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java index c21b346272..4fd6c7eed6 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ClientTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Client - */ +/** Model tests for Client */ public class ClientTest { - private final Client model = new Client(); + private final Client model = new Client(); - /** - * Model tests for Client - */ - @Test - public void testClient() { - // TODO: test Client - } - - /** - * Test the property 'client' - */ - @Test - public void clientTest() { - // TODO: test client - } + /** Model tests for Client */ + @Test + public void testClient() { + // TODO: test Client + } + /** Test the property 'client' */ + @Test + public void clientTest() { + // TODO: test client + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java index 6e4b491080..067f410546 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for DogAllOf - */ +/** Model tests for DogAllOf */ public class DogAllOfTest { - private final DogAllOf model = new DogAllOf(); + private final DogAllOf model = new DogAllOf(); - /** - * Model tests for DogAllOf - */ - @Test - public void testDogAllOf() { - // TODO: test DogAllOf - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } + /** Model tests for DogAllOf */ + @Test + public void testDogAllOf() { + // TODO: test DogAllOf + } + /** Test the property 'breed' */ + @Test + public void breedTest() { + // TODO: test breed + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java index a46bc508d4..9218b4cbe7 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/DogTest.java @@ -3,65 +3,42 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.Animal; -import org.openapitools.client.model.DogAllOf; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Dog - */ +/** Model tests for Dog */ public class DogTest { - private final Dog model = new Dog(); + private final Dog model = new Dog(); - /** - * Model tests for Dog - */ - @Test - public void testDog() { - // TODO: test Dog - } + /** Model tests for Dog */ + @Test + public void testDog() { + // TODO: test Dog + } - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } + /** Test the property 'className' */ + @Test + public void classNameTest() { + // TODO: test className + } - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } + /** Test the property 'color' */ + @Test + public void colorTest() { + // TODO: test color + } + /** Test the property 'breed' */ + @Test + public void breedTest() { + // TODO: test breed + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 45b8fbbd82..84565e8dc8 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -3,57 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for EnumArrays - */ +/** Model tests for EnumArrays */ public class EnumArraysTest { - private final EnumArrays model = new EnumArrays(); + private final EnumArrays model = new EnumArrays(); - /** - * Model tests for EnumArrays - */ - @Test - public void testEnumArrays() { - // TODO: test EnumArrays - } + /** Model tests for EnumArrays */ + @Test + public void testEnumArrays() { + // TODO: test EnumArrays + } - /** - * Test the property 'justSymbol' - */ - @Test - public void justSymbolTest() { - // TODO: test justSymbol - } - - /** - * Test the property 'arrayEnum' - */ - @Test - public void arrayEnumTest() { - // TODO: test arrayEnum - } + /** Test the property 'justSymbol' */ + @Test + public void justSymbolTest() { + // TODO: test justSymbol + } + /** Test the property 'arrayEnum' */ + @Test + public void arrayEnumTest() { + // TODO: test arrayEnum + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543fac..612c74bee7 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -3,31 +3,22 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for EnumClass - */ +/** Model tests for EnumClass */ public class EnumClassTest { - /** - * Model tests for EnumClass - */ - @Test - public void testEnumClass() { - // TODO: test EnumClass - } - + /** Model tests for EnumClass */ + @Test + public void testEnumClass() { + // TODO: test EnumClass + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java index 04e7afb197..19a61f3331 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -3,80 +3,72 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.client.model.OuterEnum; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for EnumTest - */ +/** Model tests for EnumTest */ public class EnumTestTest { - private final EnumTest model = new EnumTest(); + private final EnumTest model = new EnumTest(); - /** - * Model tests for EnumTest - */ - @Test - public void testEnumTest() { - // TODO: test EnumTest - } + /** Model tests for EnumTest */ + @Test + public void testEnumTest() { + // TODO: test EnumTest + } - /** - * Test the property 'enumString' - */ - @Test - public void enumStringTest() { - // TODO: test enumString - } + /** Test the property 'enumString' */ + @Test + public void enumStringTest() { + // TODO: test enumString + } - /** - * Test the property 'enumStringRequired' - */ - @Test - public void enumStringRequiredTest() { - // TODO: test enumStringRequired - } + /** Test the property 'enumStringRequired' */ + @Test + public void enumStringRequiredTest() { + // TODO: test enumStringRequired + } - /** - * Test the property 'enumInteger' - */ - @Test - public void enumIntegerTest() { - // TODO: test enumInteger - } + /** Test the property 'enumInteger' */ + @Test + public void enumIntegerTest() { + // TODO: test enumInteger + } - /** - * Test the property 'enumNumber' - */ - @Test - public void enumNumberTest() { - // TODO: test enumNumber - } + /** Test the property 'enumNumber' */ + @Test + public void enumNumberTest() { + // TODO: test enumNumber + } - /** - * Test the property 'outerEnum' - */ - @Test - public void outerEnumTest() { - // TODO: test outerEnum - } + /** Test the property 'outerEnum' */ + @Test + public void outerEnumTest() { + // TODO: test outerEnum + } + /** Test the property 'outerEnumInteger' */ + @Test + public void outerEnumIntegerTest() { + // TODO: test outerEnumInteger + } + + /** Test the property 'outerEnumDefaultValue' */ + @Test + public void outerEnumDefaultValueTest() { + // TODO: test outerEnumDefaultValue + } + + /** Test the property 'outerEnumIntegerDefaultValue' */ + @Test + public void outerEnumIntegerDefaultValueTest() { + // TODO: test outerEnumIntegerDefaultValue + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index ef37e666be..daf85bc331 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -3,57 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for FileSchemaTestClass - */ +/** Model tests for FileSchemaTestClass */ public class FileSchemaTestClassTest { - private final FileSchemaTestClass model = new FileSchemaTestClass(); + private final FileSchemaTestClass model = new FileSchemaTestClass(); - /** - * Model tests for FileSchemaTestClass - */ - @Test - public void testFileSchemaTestClass() { - // TODO: test FileSchemaTestClass - } + /** Model tests for FileSchemaTestClass */ + @Test + public void testFileSchemaTestClass() { + // TODO: test FileSchemaTestClass + } - /** - * Test the property 'file' - */ - @Test - public void fileTest() { - // TODO: test file - } - - /** - * Test the property 'files' - */ - @Test - public void filesTest() { - // TODO: test files - } + /** Test the property 'file' */ + @Test + public void fileTest() { + // TODO: test file + } + /** Test the property 'files' */ + @Test + public void filesTest() { + // TODO: test files + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FooTest.java new file mode 100644 index 0000000000..041cadbb39 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FooTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for Foo */ +public class FooTest { + private final Foo model = new Foo(); + + /** Model tests for Foo */ + @Test + public void testFoo() { + // TODO: test Foo + } + + /** Test the property 'bar' */ + @Test + public void barTest() { + // TODO: test bar + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java index 710501b51b..0352bcb57e 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -3,156 +3,114 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.File; -import java.math.BigDecimal; -import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for FormatTest - */ +/** Model tests for FormatTest */ public class FormatTestTest { - private final FormatTest model = new FormatTest(); + private final FormatTest model = new FormatTest(); - /** - * Model tests for FormatTest - */ - @Test - public void testFormatTest() { - // TODO: test FormatTest - } + /** Model tests for FormatTest */ + @Test + public void testFormatTest() { + // TODO: test FormatTest + } - /** - * Test the property 'integer' - */ - @Test - public void integerTest() { - // TODO: test integer - } + /** Test the property 'integer' */ + @Test + public void integerTest() { + // TODO: test integer + } - /** - * Test the property 'int32' - */ - @Test - public void int32Test() { - // TODO: test int32 - } + /** Test the property 'int32' */ + @Test + public void int32Test() { + // TODO: test int32 + } - /** - * Test the property 'int64' - */ - @Test - public void int64Test() { - // TODO: test int64 - } + /** Test the property 'int64' */ + @Test + public void int64Test() { + // TODO: test int64 + } - /** - * Test the property 'number' - */ - @Test - public void numberTest() { - // TODO: test number - } + /** Test the property 'number' */ + @Test + public void numberTest() { + // TODO: test number + } - /** - * Test the property '_float' - */ - @Test - public void _floatTest() { - // TODO: test _float - } + /** Test the property '_float' */ + @Test + public void _floatTest() { + // TODO: test _float + } - /** - * Test the property '_double' - */ - @Test - public void _doubleTest() { - // TODO: test _double - } + /** Test the property '_double' */ + @Test + public void _doubleTest() { + // TODO: test _double + } - /** - * Test the property 'string' - */ - @Test - public void stringTest() { - // TODO: test string - } + /** Test the property 'string' */ + @Test + public void stringTest() { + // TODO: test string + } - /** - * Test the property '_byte' - */ - @Test - public void _byteTest() { - // TODO: test _byte - } + /** Test the property '_byte' */ + @Test + public void _byteTest() { + // TODO: test _byte + } - /** - * Test the property 'binary' - */ - @Test - public void binaryTest() { - // TODO: test binary - } + /** Test the property 'binary' */ + @Test + public void binaryTest() { + // TODO: test binary + } - /** - * Test the property 'date' - */ - @Test - public void dateTest() { - // TODO: test date - } + /** Test the property 'date' */ + @Test + public void dateTest() { + // TODO: test date + } - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } + /** Test the property 'dateTime' */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } + /** Test the property 'uuid' */ + @Test + public void uuidTest() { + // TODO: test uuid + } - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } + /** Test the property 'password' */ + @Test + public void passwordTest() { + // TODO: test password + } - /** - * Test the property 'bigDecimal' - */ - @Test - public void bigDecimalTest() { - // TODO: test bigDecimal - } + /** Test the property 'patternWithDigits' */ + @Test + public void patternWithDigitsTest() { + // TODO: test patternWithDigits + } + /** Test the property 'patternWithDigitsAndDelimiter' */ + @Test + public void patternWithDigitsAndDelimiterTest() { + // TODO: test patternWithDigitsAndDelimiter + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index e902c10038..8003b98d3f 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -3,55 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for HasOnlyReadOnly - */ +/** Model tests for HasOnlyReadOnly */ public class HasOnlyReadOnlyTest { - private final HasOnlyReadOnly model = new HasOnlyReadOnly(); + private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - /** - * Model tests for HasOnlyReadOnly - */ - @Test - public void testHasOnlyReadOnly() { - // TODO: test HasOnlyReadOnly - } + /** Model tests for HasOnlyReadOnly */ + @Test + public void testHasOnlyReadOnly() { + // TODO: test HasOnlyReadOnly + } - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'foo' - */ - @Test - public void fooTest() { - // TODO: test foo - } + /** Test the property 'bar' */ + @Test + public void barTest() { + // TODO: test bar + } + /** Test the property 'foo' */ + @Test + public void fooTest() { + // TODO: test foo + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java new file mode 100644 index 0000000000..d95e717df8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for HealthCheckResult */ +public class HealthCheckResultTest { + private final HealthCheckResult model = new HealthCheckResult(); + + /** Model tests for HealthCheckResult */ + @Test + public void testHealthCheckResult() { + // TODO: test HealthCheckResult + } + + /** Test the property 'nullableMessage' */ + @Test + public void nullableMessageTest() { + // TODO: test nullableMessage + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject1Test.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject1Test.java new file mode 100644 index 0000000000..09d84e4bc5 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject1Test.java @@ -0,0 +1,38 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject1 */ +public class InlineObject1Test { + private final InlineObject1 model = new InlineObject1(); + + /** Model tests for InlineObject1 */ + @Test + public void testInlineObject1() { + // TODO: test InlineObject1 + } + + /** Test the property 'additionalMetadata' */ + @Test + public void additionalMetadataTest() { + // TODO: test additionalMetadata + } + + /** Test the property 'file' */ + @Test + public void fileTest() { + // TODO: test file + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject2Test.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject2Test.java new file mode 100644 index 0000000000..797b297ddd --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject2Test.java @@ -0,0 +1,38 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject2 */ +public class InlineObject2Test { + private final InlineObject2 model = new InlineObject2(); + + /** Model tests for InlineObject2 */ + @Test + public void testInlineObject2() { + // TODO: test InlineObject2 + } + + /** Test the property 'enumFormStringArray' */ + @Test + public void enumFormStringArrayTest() { + // TODO: test enumFormStringArray + } + + /** Test the property 'enumFormString' */ + @Test + public void enumFormStringTest() { + // TODO: test enumFormString + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject3Test.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject3Test.java new file mode 100644 index 0000000000..4e60b5d4e6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject3Test.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject3 */ +public class InlineObject3Test { + private final InlineObject3 model = new InlineObject3(); + + /** Model tests for InlineObject3 */ + @Test + public void testInlineObject3() { + // TODO: test InlineObject3 + } + + /** Test the property 'integer' */ + @Test + public void integerTest() { + // TODO: test integer + } + + /** Test the property 'int32' */ + @Test + public void int32Test() { + // TODO: test int32 + } + + /** Test the property 'int64' */ + @Test + public void int64Test() { + // TODO: test int64 + } + + /** Test the property 'number' */ + @Test + public void numberTest() { + // TODO: test number + } + + /** Test the property '_float' */ + @Test + public void _floatTest() { + // TODO: test _float + } + + /** Test the property '_double' */ + @Test + public void _doubleTest() { + // TODO: test _double + } + + /** Test the property 'string' */ + @Test + public void stringTest() { + // TODO: test string + } + + /** Test the property 'patternWithoutDelimiter' */ + @Test + public void patternWithoutDelimiterTest() { + // TODO: test patternWithoutDelimiter + } + + /** Test the property '_byte' */ + @Test + public void _byteTest() { + // TODO: test _byte + } + + /** Test the property 'binary' */ + @Test + public void binaryTest() { + // TODO: test binary + } + + /** Test the property 'date' */ + @Test + public void dateTest() { + // TODO: test date + } + + /** Test the property 'dateTime' */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + + /** Test the property 'password' */ + @Test + public void passwordTest() { + // TODO: test password + } + + /** Test the property 'callback' */ + @Test + public void callbackTest() { + // TODO: test callback + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject4Test.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject4Test.java new file mode 100644 index 0000000000..c03f7058e1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject4Test.java @@ -0,0 +1,38 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject4 */ +public class InlineObject4Test { + private final InlineObject4 model = new InlineObject4(); + + /** Model tests for InlineObject4 */ + @Test + public void testInlineObject4() { + // TODO: test InlineObject4 + } + + /** Test the property 'param' */ + @Test + public void paramTest() { + // TODO: test param + } + + /** Test the property 'param2' */ + @Test + public void param2Test() { + // TODO: test param2 + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject5Test.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject5Test.java new file mode 100644 index 0000000000..322e6fe99b --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObject5Test.java @@ -0,0 +1,38 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject5 */ +public class InlineObject5Test { + private final InlineObject5 model = new InlineObject5(); + + /** Model tests for InlineObject5 */ + @Test + public void testInlineObject5() { + // TODO: test InlineObject5 + } + + /** Test the property 'additionalMetadata' */ + @Test + public void additionalMetadataTest() { + // TODO: test additionalMetadata + } + + /** Test the property 'requiredFile' */ + @Test + public void requiredFileTest() { + // TODO: test requiredFile + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObjectTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObjectTest.java new file mode 100644 index 0000000000..7a7bff5a4d --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineObjectTest.java @@ -0,0 +1,38 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineObject */ +public class InlineObjectTest { + private final InlineObject model = new InlineObject(); + + /** Model tests for InlineObject */ + @Test + public void testInlineObject() { + // TODO: test InlineObject + } + + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } + + /** Test the property 'status' */ + @Test + public void statusTest() { + // TODO: test status + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java new file mode 100644 index 0000000000..b3e1afbb48 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/InlineResponseDefaultTest.java @@ -0,0 +1,32 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for InlineResponseDefault */ +public class InlineResponseDefaultTest { + private final InlineResponseDefault model = new InlineResponseDefault(); + + /** Model tests for InlineResponseDefault */ + @Test + public void testInlineResponseDefault() { + // TODO: test InlineResponseDefault + } + + /** Test the property 'string' */ + @Test + public void stringTest() { + // TODO: test string + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java index a0c991bb75..d13b22eb9c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -3,74 +3,48 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for MapTest - */ +/** Model tests for MapTest */ public class MapTestTest { - private final MapTest model = new MapTest(); + private final MapTest model = new MapTest(); - /** - * Model tests for MapTest - */ - @Test - public void testMapTest() { - // TODO: test MapTest - } + /** Model tests for MapTest */ + @Test + public void testMapTest() { + // TODO: test MapTest + } - /** - * Test the property 'mapMapOfString' - */ - @Test - public void mapMapOfStringTest() { - // TODO: test mapMapOfString - } + /** Test the property 'mapMapOfString' */ + @Test + public void mapMapOfStringTest() { + // TODO: test mapMapOfString + } - /** - * Test the property 'mapOfEnumString' - */ - @Test - public void mapOfEnumStringTest() { - // TODO: test mapOfEnumString - } + /** Test the property 'mapOfEnumString' */ + @Test + public void mapOfEnumStringTest() { + // TODO: test mapOfEnumString + } - /** - * Test the property 'directMap' - */ - @Test - public void directMapTest() { - // TODO: test directMap - } - - /** - * Test the property 'indirectMap' - */ - @Test - public void indirectMapTest() { - // TODO: test indirectMap - } + /** Test the property 'directMap' */ + @Test + public void directMapTest() { + // TODO: test directMap + } + /** Test the property 'indirectMap' */ + @Test + public void indirectMapTest() { + // TODO: test indirectMap + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f8a8c734ba..1c31132b63 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -3,69 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.client.model.Animal; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ +/** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + private final MixedPropertiesAndAdditionalPropertiesClass model = + new MixedPropertiesAndAdditionalPropertiesClass(); - /** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ - @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { - // TODO: test MixedPropertiesAndAdditionalPropertiesClass - } + /** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ + @Test + public void testMixedPropertiesAndAdditionalPropertiesClass() { + // TODO: test MixedPropertiesAndAdditionalPropertiesClass + } - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } + /** Test the property 'uuid' */ + @Test + public void uuidTest() { + // TODO: test uuid + } - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'map' - */ - @Test - public void mapTest() { - // TODO: test map - } + /** Test the property 'dateTime' */ + @Test + public void dateTimeTest() { + // TODO: test dateTime + } + /** Test the property 'map' */ + @Test + public void mapTest() { + // TODO: test map + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 82c7208079..5100638e4a 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -3,55 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Model200Response - */ +/** Model tests for Model200Response */ public class Model200ResponseTest { - private final Model200Response model = new Model200Response(); + private final Model200Response model = new Model200Response(); - /** - * Model tests for Model200Response - */ - @Test - public void testModel200Response() { - // TODO: test Model200Response - } + /** Model tests for Model200Response */ + @Test + public void testModel200Response() { + // TODO: test Model200Response + } - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } + /** Test the property 'propertyClass' */ + @Test + public void propertyClassTest() { + // TODO: test propertyClass + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index 97a1287aa4..73815c5cd2 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -3,63 +3,42 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ModelApiResponse - */ +/** Model tests for ModelApiResponse */ public class ModelApiResponseTest { - private final ModelApiResponse model = new ModelApiResponse(); + private final ModelApiResponse model = new ModelApiResponse(); - /** - * Model tests for ModelApiResponse - */ - @Test - public void testModelApiResponse() { - // TODO: test ModelApiResponse - } + /** Model tests for ModelApiResponse */ + @Test + public void testModelApiResponse() { + // TODO: test ModelApiResponse + } - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } + /** Test the property 'code' */ + @Test + public void codeTest() { + // TODO: test code + } - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } + /** Test the property 'type' */ + @Test + public void typeTest() { + // TODO: test type + } + /** Test the property 'message' */ + @Test + public void messageTest() { + // TODO: test message + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java index f884519ebc..7a9283f8e3 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ModelReturn - */ +/** Model tests for ModelReturn */ public class ModelReturnTest { - private final ModelReturn model = new ModelReturn(); + private final ModelReturn model = new ModelReturn(); - /** - * Model tests for ModelReturn - */ - @Test - public void testModelReturn() { - // TODO: test ModelReturn - } - - /** - * Test the property '_return' - */ - @Test - public void _returnTest() { - // TODO: test _return - } + /** Model tests for ModelReturn */ + @Test + public void testModelReturn() { + // TODO: test ModelReturn + } + /** Test the property '_return' */ + @Test + public void _returnTest() { + // TODO: test _return + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java index cb3a94cf74..25e9e4235d 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NameTest.java @@ -3,71 +3,48 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Name - */ +/** Model tests for Name */ public class NameTest { - private final Name model = new Name(); + private final Name model = new Name(); - /** - * Model tests for Name - */ - @Test - public void testName() { - // TODO: test Name - } + /** Model tests for Name */ + @Test + public void testName() { + // TODO: test Name + } - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } - /** - * Test the property 'snakeCase' - */ - @Test - public void snakeCaseTest() { - // TODO: test snakeCase - } + /** Test the property 'snakeCase' */ + @Test + public void snakeCaseTest() { + // TODO: test snakeCase + } - /** - * Test the property 'property' - */ - @Test - public void propertyTest() { - // TODO: test property - } - - /** - * Test the property '_123number' - */ - @Test - public void _123numberTest() { - // TODO: test _123number - } + /** Test the property 'property' */ + @Test + public void propertyTest() { + // TODO: test property + } + /** Test the property '_123number' */ + @Test + public void _123numberTest() { + // TODO: test _123number + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NullableClassTest.java new file mode 100644 index 0000000000..75bd91eb2a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -0,0 +1,98 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for NullableClass */ +public class NullableClassTest { + private final NullableClass model = new NullableClass(); + + /** Model tests for NullableClass */ + @Test + public void testNullableClass() { + // TODO: test NullableClass + } + + /** Test the property 'integerProp' */ + @Test + public void integerPropTest() { + // TODO: test integerProp + } + + /** Test the property 'numberProp' */ + @Test + public void numberPropTest() { + // TODO: test numberProp + } + + /** Test the property 'booleanProp' */ + @Test + public void booleanPropTest() { + // TODO: test booleanProp + } + + /** Test the property 'stringProp' */ + @Test + public void stringPropTest() { + // TODO: test stringProp + } + + /** Test the property 'dateProp' */ + @Test + public void datePropTest() { + // TODO: test dateProp + } + + /** Test the property 'datetimeProp' */ + @Test + public void datetimePropTest() { + // TODO: test datetimeProp + } + + /** Test the property 'arrayNullableProp' */ + @Test + public void arrayNullablePropTest() { + // TODO: test arrayNullableProp + } + + /** Test the property 'arrayAndItemsNullableProp' */ + @Test + public void arrayAndItemsNullablePropTest() { + // TODO: test arrayAndItemsNullableProp + } + + /** Test the property 'arrayItemsNullable' */ + @Test + public void arrayItemsNullableTest() { + // TODO: test arrayItemsNullable + } + + /** Test the property 'objectNullableProp' */ + @Test + public void objectNullablePropTest() { + // TODO: test objectNullableProp + } + + /** Test the property 'objectAndItemsNullableProp' */ + @Test + public void objectAndItemsNullablePropTest() { + // TODO: test objectAndItemsNullableProp + } + + /** Test the property 'objectItemsNullable' */ + @Test + public void objectItemsNullableTest() { + // TODO: test objectItemsNullable + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index f4fbd5ee8b..5890374249 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -3,48 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for NumberOnly - */ +/** Model tests for NumberOnly */ public class NumberOnlyTest { - private final NumberOnly model = new NumberOnly(); + private final NumberOnly model = new NumberOnly(); - /** - * Model tests for NumberOnly - */ - @Test - public void testNumberOnly() { - // TODO: test NumberOnly - } - - /** - * Test the property 'justNumber' - */ - @Test - public void justNumberTest() { - // TODO: test justNumber - } + /** Model tests for NumberOnly */ + @Test + public void testNumberOnly() { + // TODO: test NumberOnly + } + /** Test the property 'justNumber' */ + @Test + public void justNumberTest() { + // TODO: test justNumber + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java index d24c8479f5..4ab5900bc6 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OrderTest.java @@ -3,88 +3,60 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Order - */ +/** Model tests for Order */ public class OrderTest { - private final Order model = new Order(); + private final Order model = new Order(); - /** - * Model tests for Order - */ - @Test - public void testOrder() { - // TODO: test Order - } + /** Model tests for Order */ + @Test + public void testOrder() { + // TODO: test Order + } - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } - /** - * Test the property 'petId' - */ - @Test - public void petIdTest() { - // TODO: test petId - } + /** Test the property 'petId' */ + @Test + public void petIdTest() { + // TODO: test petId + } - /** - * Test the property 'quantity' - */ - @Test - public void quantityTest() { - // TODO: test quantity - } + /** Test the property 'quantity' */ + @Test + public void quantityTest() { + // TODO: test quantity + } - /** - * Test the property 'shipDate' - */ - @Test - public void shipDateTest() { - // TODO: test shipDate - } + /** Test the property 'shipDate' */ + @Test + public void shipDateTest() { + // TODO: test shipDate + } - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - - /** - * Test the property 'complete' - */ - @Test - public void completeTest() { - // TODO: test complete - } + /** Test the property 'status' */ + @Test + public void statusTest() { + // TODO: test status + } + /** Test the property 'complete' */ + @Test + public void completeTest() { + // TODO: test complete + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index ebea3ca304..34a36bc70c 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -3,64 +3,42 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for OuterComposite - */ +/** Model tests for OuterComposite */ public class OuterCompositeTest { - private final OuterComposite model = new OuterComposite(); + private final OuterComposite model = new OuterComposite(); - /** - * Model tests for OuterComposite - */ - @Test - public void testOuterComposite() { - // TODO: test OuterComposite - } + /** Model tests for OuterComposite */ + @Test + public void testOuterComposite() { + // TODO: test OuterComposite + } - /** - * Test the property 'myNumber' - */ - @Test - public void myNumberTest() { - // TODO: test myNumber - } + /** Test the property 'myNumber' */ + @Test + public void myNumberTest() { + // TODO: test myNumber + } - /** - * Test the property 'myString' - */ - @Test - public void myStringTest() { - // TODO: test myString - } - - /** - * Test the property 'myBoolean' - */ - @Test - public void myBooleanTest() { - // TODO: test myBoolean - } + /** Test the property 'myString' */ + @Test + public void myStringTest() { + // TODO: test myString + } + /** Test the property 'myBoolean' */ + @Test + public void myBooleanTest() { + // TODO: test myBoolean + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java new file mode 100644 index 0000000000..532de56f37 --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -0,0 +1,24 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for OuterEnumDefaultValue */ +public class OuterEnumDefaultValueTest { + /** Model tests for OuterEnumDefaultValue */ + @Test + public void testOuterEnumDefaultValue() { + // TODO: test OuterEnumDefaultValue + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java new file mode 100644 index 0000000000..d84b8439bf --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -0,0 +1,24 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for OuterEnumIntegerDefaultValue */ +public class OuterEnumIntegerDefaultValueTest { + /** Model tests for OuterEnumIntegerDefaultValue */ + @Test + public void testOuterEnumIntegerDefaultValue() { + // TODO: test OuterEnumIntegerDefaultValue + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java new file mode 100644 index 0000000000..fa41152d9a --- /dev/null +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -0,0 +1,24 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.client.model; + +import org.junit.Test; + +/** Model tests for OuterEnumInteger */ +public class OuterEnumIntegerTest { + /** Model tests for OuterEnumInteger */ + @Test + public void testOuterEnumInteger() { + // TODO: test OuterEnumInteger + } +} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0fa..fedf75f025 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -3,31 +3,22 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for OuterEnum - */ +/** Model tests for OuterEnum */ public class OuterEnumTest { - /** - * Model tests for OuterEnum - */ - @Test - public void testOuterEnum() { - // TODO: test OuterEnum - } - + /** Model tests for OuterEnum */ + @Test + public void testOuterEnum() { + // TODO: test OuterEnum + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java index c3c0d4cc35..fb50cb4a80 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/PetTest.java @@ -3,91 +3,60 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Pet - */ +/** Model tests for Pet */ public class PetTest { - private final Pet model = new Pet(); + private final Pet model = new Pet(); - /** - * Model tests for Pet - */ - @Test - public void testPet() { - // TODO: test Pet - } + /** Model tests for Pet */ + @Test + public void testPet() { + // TODO: test Pet + } - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } - /** - * Test the property 'category' - */ - @Test - public void categoryTest() { - // TODO: test category - } + /** Test the property 'category' */ + @Test + public void categoryTest() { + // TODO: test category + } - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } - /** - * Test the property 'photoUrls' - */ - @Test - public void photoUrlsTest() { - // TODO: test photoUrls - } + /** Test the property 'photoUrls' */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } + /** Test the property 'tags' */ + @Test + public void tagsTest() { + // TODO: test tags + } + /** Test the property 'status' */ + @Test + public void statusTest() { + // TODO: test status + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index b82a7d0ef5..f78797805b 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -3,55 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for ReadOnlyFirst - */ +/** Model tests for ReadOnlyFirst */ public class ReadOnlyFirstTest { - private final ReadOnlyFirst model = new ReadOnlyFirst(); + private final ReadOnlyFirst model = new ReadOnlyFirst(); - /** - * Model tests for ReadOnlyFirst - */ - @Test - public void testReadOnlyFirst() { - // TODO: test ReadOnlyFirst - } + /** Model tests for ReadOnlyFirst */ + @Test + public void testReadOnlyFirst() { + // TODO: test ReadOnlyFirst + } - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'baz' - */ - @Test - public void bazTest() { - // TODO: test baz - } + /** Test the property 'bar' */ + @Test + public void barTest() { + // TODO: test bar + } + /** Test the property 'baz' */ + @Test + public void bazTest() { + // TODO: test baz + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index d5a19c371e..d5103f58db 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -3,47 +3,30 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for SpecialModelName - */ +/** Model tests for SpecialModelName */ public class SpecialModelNameTest { - private final SpecialModelName model = new SpecialModelName(); + private final SpecialModelName model = new SpecialModelName(); - /** - * Model tests for SpecialModelName - */ - @Test - public void testSpecialModelName() { - // TODO: test SpecialModelName - } - - /** - * Test the property '$specialPropertyName' - */ - @Test - public void $specialPropertyNameTest() { - // TODO: test $specialPropertyName - } + /** Model tests for SpecialModelName */ + @Test + public void testSpecialModelName() { + // TODO: test SpecialModelName + } + /** Test the property '$specialPropertyName' */ + @Test + public void $specialPropertyNameTest() { + // TODO: test $specialPropertyName + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java index 5c2cc6f49e..459a4e165d 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TagTest.java @@ -3,55 +3,36 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for Tag - */ +/** Model tests for Tag */ public class TagTest { - private final Tag model = new Tag(); + private final Tag model = new Tag(); - /** - * Model tests for Tag - */ - @Test - public void testTag() { - // TODO: test Tag - } + /** Model tests for Tag */ + @Test + public void testTag() { + // TODO: test Tag + } - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } + /** Test the property 'name' */ + @Test + public void nameTest() { + // TODO: test name + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java deleted file mode 100644 index e96ac74443..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderDefaultTest.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for TypeHolderDefault - */ -public class TypeHolderDefaultTest { - private final TypeHolderDefault model = new TypeHolderDefault(); - - /** - * Model tests for TypeHolderDefault - */ - @Test - public void testTypeHolderDefault() { - // TODO: test TypeHolderDefault - } - - /** - * Test the property 'stringItem' - */ - @Test - public void stringItemTest() { - // TODO: test stringItem - } - - /** - * Test the property 'numberItem' - */ - @Test - public void numberItemTest() { - // TODO: test numberItem - } - - /** - * Test the property 'integerItem' - */ - @Test - public void integerItemTest() { - // TODO: test integerItem - } - - /** - * Test the property 'boolItem' - */ - @Test - public void boolItemTest() { - // TODO: test boolItem - } - - /** - * Test the property 'arrayItem' - */ - @Test - public void arrayItemTest() { - // TODO: test arrayItem - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java deleted file mode 100644 index 56641d163a..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/TypeHolderExampleTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for TypeHolderExample - */ -public class TypeHolderExampleTest { - private final TypeHolderExample model = new TypeHolderExample(); - - /** - * Model tests for TypeHolderExample - */ - @Test - public void testTypeHolderExample() { - // TODO: test TypeHolderExample - } - - /** - * Test the property 'stringItem' - */ - @Test - public void stringItemTest() { - // TODO: test stringItem - } - - /** - * Test the property 'numberItem' - */ - @Test - public void numberItemTest() { - // TODO: test numberItem - } - - /** - * Test the property 'floatItem' - */ - @Test - public void floatItemTest() { - // TODO: test floatItem - } - - /** - * Test the property 'integerItem' - */ - @Test - public void integerItemTest() { - // TODO: test integerItem - } - - /** - * Test the property 'boolItem' - */ - @Test - public void boolItemTest() { - // TODO: test boolItem - } - - /** - * Test the property 'arrayItem' - */ - @Test - public void arrayItemTest() { - // TODO: test arrayItem - } - -} diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java index ce40d3a2a6..44acdc6fdc 100644 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/UserTest.java @@ -3,103 +3,72 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; - -/** - * Model tests for User - */ +/** Model tests for User */ public class UserTest { - private final User model = new User(); + private final User model = new User(); - /** - * Model tests for User - */ - @Test - public void testUser() { - // TODO: test User - } + /** Model tests for User */ + @Test + public void testUser() { + // TODO: test User + } - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } + /** Test the property 'id' */ + @Test + public void idTest() { + // TODO: test id + } - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } + /** Test the property 'username' */ + @Test + public void usernameTest() { + // TODO: test username + } - /** - * Test the property 'firstName' - */ - @Test - public void firstNameTest() { - // TODO: test firstName - } + /** Test the property 'firstName' */ + @Test + public void firstNameTest() { + // TODO: test firstName + } - /** - * Test the property 'lastName' - */ - @Test - public void lastNameTest() { - // TODO: test lastName - } + /** Test the property 'lastName' */ + @Test + public void lastNameTest() { + // TODO: test lastName + } - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } + /** Test the property 'email' */ + @Test + public void emailTest() { + // TODO: test email + } - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } + /** Test the property 'password' */ + @Test + public void passwordTest() { + // TODO: test password + } - /** - * Test the property 'phone' - */ - @Test - public void phoneTest() { - // TODO: test phone - } - - /** - * Test the property 'userStatus' - */ - @Test - public void userStatusTest() { - // TODO: test userStatus - } + /** Test the property 'phone' */ + @Test + public void phoneTest() { + // TODO: test phone + } + /** Test the property 'userStatus' */ + @Test + public void userStatusTest() { + // TODO: test userStatus + } } diff --git a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java b/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java deleted file mode 100644 index 501c414555..0000000000 --- a/samples/client/petstore/java/jersey2-experimental/src/test/java/org/openapitools/client/model/XmlItemTest.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.openapitools.client.model; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - - -/** - * Model tests for XmlItem - */ -public class XmlItemTest { - private final XmlItem model = new XmlItem(); - - /** - * Model tests for XmlItem - */ - @Test - public void testXmlItem() { - // TODO: test XmlItem - } - - /** - * Test the property 'attributeString' - */ - @Test - public void attributeStringTest() { - // TODO: test attributeString - } - - /** - * Test the property 'attributeNumber' - */ - @Test - public void attributeNumberTest() { - // TODO: test attributeNumber - } - - /** - * Test the property 'attributeInteger' - */ - @Test - public void attributeIntegerTest() { - // TODO: test attributeInteger - } - - /** - * Test the property 'attributeBoolean' - */ - @Test - public void attributeBooleanTest() { - // TODO: test attributeBoolean - } - - /** - * Test the property 'wrappedArray' - */ - @Test - public void wrappedArrayTest() { - // TODO: test wrappedArray - } - - /** - * Test the property 'nameString' - */ - @Test - public void nameStringTest() { - // TODO: test nameString - } - - /** - * Test the property 'nameNumber' - */ - @Test - public void nameNumberTest() { - // TODO: test nameNumber - } - - /** - * Test the property 'nameInteger' - */ - @Test - public void nameIntegerTest() { - // TODO: test nameInteger - } - - /** - * Test the property 'nameBoolean' - */ - @Test - public void nameBooleanTest() { - // TODO: test nameBoolean - } - - /** - * Test the property 'nameArray' - */ - @Test - public void nameArrayTest() { - // TODO: test nameArray - } - - /** - * Test the property 'nameWrappedArray' - */ - @Test - public void nameWrappedArrayTest() { - // TODO: test nameWrappedArray - } - - /** - * Test the property 'prefixString' - */ - @Test - public void prefixStringTest() { - // TODO: test prefixString - } - - /** - * Test the property 'prefixNumber' - */ - @Test - public void prefixNumberTest() { - // TODO: test prefixNumber - } - - /** - * Test the property 'prefixInteger' - */ - @Test - public void prefixIntegerTest() { - // TODO: test prefixInteger - } - - /** - * Test the property 'prefixBoolean' - */ - @Test - public void prefixBooleanTest() { - // TODO: test prefixBoolean - } - - /** - * Test the property 'prefixArray' - */ - @Test - public void prefixArrayTest() { - // TODO: test prefixArray - } - - /** - * Test the property 'prefixWrappedArray' - */ - @Test - public void prefixWrappedArrayTest() { - // TODO: test prefixWrappedArray - } - - /** - * Test the property 'namespaceString' - */ - @Test - public void namespaceStringTest() { - // TODO: test namespaceString - } - - /** - * Test the property 'namespaceNumber' - */ - @Test - public void namespaceNumberTest() { - // TODO: test namespaceNumber - } - - /** - * Test the property 'namespaceInteger' - */ - @Test - public void namespaceIntegerTest() { - // TODO: test namespaceInteger - } - - /** - * Test the property 'namespaceBoolean' - */ - @Test - public void namespaceBooleanTest() { - // TODO: test namespaceBoolean - } - - /** - * Test the property 'namespaceArray' - */ - @Test - public void namespaceArrayTest() { - // TODO: test namespaceArray - } - - /** - * Test the property 'namespaceWrappedArray' - */ - @Test - public void namespaceWrappedArrayTest() { - // TODO: test namespaceWrappedArray - } - - /** - * Test the property 'prefixNsString' - */ - @Test - public void prefixNsStringTest() { - // TODO: test prefixNsString - } - - /** - * Test the property 'prefixNsNumber' - */ - @Test - public void prefixNsNumberTest() { - // TODO: test prefixNsNumber - } - - /** - * Test the property 'prefixNsInteger' - */ - @Test - public void prefixNsIntegerTest() { - // TODO: test prefixNsInteger - } - - /** - * Test the property 'prefixNsBoolean' - */ - @Test - public void prefixNsBooleanTest() { - // TODO: test prefixNsBoolean - } - - /** - * Test the property 'prefixNsArray' - */ - @Test - public void prefixNsArrayTest() { - // TODO: test prefixNsArray - } - - /** - * Test the property 'prefixNsWrappedArray' - */ - @Test - public void prefixNsWrappedArrayTest() { - // TODO: test prefixNsWrappedArray - } - -} diff --git a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml index 8ac184e2ef..af7148414b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml +++ b/samples/openapi3/client/petstore/go/go-petstore/api/openapi.yaml @@ -1194,7 +1194,8 @@ paths: responses: "200": description: The instance started successfully - security: [] + security: + - http_signature_test: [] summary: test http signature authentication tags: - fake 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 eab45b0e2c..e0f01098a5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeApi.md @@ -82,7 +82,7 @@ Name | Type | Description | Notes ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md index 20d18e8499..5046a502e1 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/docs/Api/FakeApi.md @@ -85,10 +85,13 @@ test http signature authentication require_once(__DIR__ . '/vendor/autoload.php'); + + $apiInstance = new OpenAPI\Client\Api\FakeApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); $pet = new \OpenAPI\Client\Model\Pet(); // \OpenAPI\Client\Model\Pet | Pet object that needs to be added to the store $query_1 = 'query_1_example'; // string | query parameter @@ -117,7 +120,7 @@ void (empty response body) ### Authorization -No authorization required +[http_signature_test](../../README.md#http_signature_test) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index cf1e1179db..50de8cc758 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -96,9 +96,73 @@ 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) + ) +) # Enter a context with an instance of the API client -with petstore_api.ApiClient() as api_client: +with petstore_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) pet = petstore_api.Pet() # Pet | Pet object that needs to be added to the store @@ -126,7 +190,7 @@ void (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers 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 71be34c74b..01f431fb43 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 @@ -243,7 +243,7 @@ class FakeApi(object): ['application/json', 'application/xml']) # noqa: E501 # Authentication setting - auth_settings = [] # noqa: E501 + auth_settings = ['http_signature_test'] # noqa: E501 return self.api_client.call_api( '/fake/http-signature-test', 'GET', diff --git a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md index a8256c46dd..4552514bc7 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby-faraday/docs/FakeApi.md @@ -74,6 +74,9 @@ test http signature authentication ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| +end api_instance = Petstore::FakeApi.new pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store @@ -105,7 +108,7 @@ nil (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 26194b07ed..293aeaa698 100644 --- a/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -121,7 +121,7 @@ module Petstore return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['http_signature_test'] new_options = opts.merge( :header_params => header_params, diff --git a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md index a8256c46dd..4552514bc7 100644 --- a/samples/openapi3/client/petstore/ruby/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/ruby/docs/FakeApi.md @@ -74,6 +74,9 @@ test http signature authentication ```ruby # load the gem require 'petstore' +# setup authorization +Petstore.configure do |config| +end api_instance = Petstore::FakeApi.new pet = Petstore::Pet.new # Pet | Pet object that needs to be added to the store @@ -105,7 +108,7 @@ nil (empty response body) ### Authorization -No authorization required +[http_signature_test](../README.md#http_signature_test) ### HTTP request headers diff --git a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb index 26194b07ed..293aeaa698 100644 --- a/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/openapi3/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -121,7 +121,7 @@ module Petstore return_type = opts[:return_type] # auth_names - auth_names = opts[:auth_names] || [] + auth_names = opts[:auth_names] || ['http_signature_test'] new_options = opts.merge( :header_params => header_params, diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java index 9d984b5090..76b5c00f7d 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/FakeApi.java @@ -80,7 +80,9 @@ public class FakeApi { @Path("/http-signature-test") @Consumes({ "application/json", "application/xml" }) - @io.swagger.annotations.ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, tags={ "fake", }) + @io.swagger.annotations.ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = { + @io.swagger.annotations.Authorization(value = "http_signature_test") + }, tags={ "fake", }) @io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) }) public Response fakeHttpSignatureTest(@ApiParam(value = "Pet object that needs to be added to the store", required = true) @NotNull @Valid Pet pet From eccdf1d6675ca56405234fee32d4c06a5d4c6ba6 Mon Sep 17 00:00:00 2001 From: Alexander Hirner Date: Mon, 27 Apr 2020 18:10:42 +0200 Subject: [PATCH 23/25] add MoonVision user (#6076) * add MoonVision user * add moonvision to readme list --- README.md | 1 + website/src/dynamic/users.yml | 5 +++++ website/static/img/companies/moonvision.png | Bin 0 -> 10935 bytes 3 files changed, 6 insertions(+) create mode 100644 website/static/img/companies/moonvision.png diff --git a/README.md b/README.md index 1fa10dd45e..0e45c2ff47 100644 --- a/README.md +++ b/README.md @@ -614,6 +614,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in - [MailSlurp](https://www.mailslurp.com) - [Médiavision](https://www.mediavision.fr/) - [Metaswitch](https://www.metaswitch.com/) +- [MoonVision](https://www.moonvision.io/) - [Myworkout](https://myworkout.com) - [NamSor](https://www.namsor.com/) - [Openet](https://www.openet.com/) diff --git a/website/src/dynamic/users.yml b/website/src/dynamic/users.yml index da74a98af9..835ff1d0b5 100644 --- a/website/src/dynamic/users.yml +++ b/website/src/dynamic/users.yml @@ -243,6 +243,11 @@ image: "img/companies/metaswitch.svg" infoLink: "https://www.metaswitch.com/" pinned: true +- + caption: MoonVision + image: "img/companies/moonvision.png" + infoLink: "https://www.moonvision.io/" + pinned: false - caption: Myworkout image: "img/companies/myworkout.png" diff --git a/website/static/img/companies/moonvision.png b/website/static/img/companies/moonvision.png new file mode 100644 index 0000000000000000000000000000000000000000..b04d7116f973945a2fddc35538a86ae8478fa053 GIT binary patch literal 10935 zcmaiacQ~9+)HbooD$!Y@_ZnqIbXM=ZN3V+@Sb`|A`dYpB)k1X9dx#osi6Dp`S-nIe zk>K0k`~Cf1??2D;Tr+3R+;e8;%$euhiH7uTUl$iY3F(v(XfB5G@frXZ4)z*Cvn;sStde4~`>(Pb3E6S8xE}f!* zTf&EJKLO<0rnwqDv5ZSzNzH?-#V1=veE}g?b(gT(DOvby;*ZX$Iv%CJt3Mgm)>Uz* z*#){{dyb^hFc2DMwHsmbzTZ-_NfD6i#>#KUDPvNqR+zI2T01|3Qnlsgv4xJ&)?H7} z8?BapIRRJMW2=j>m|>a_`uYh<&)L<8_o`XnCf%_r88YUX?f0dmS$$;FQxJVb*rx0m zKX9J6RW91MFixH0@Hi0>RQyesq}UZBBX{Okc(1Rcm@4Z>D)OHhT*{dho>rp6e>0Ig zgBZ&bjOMhYaG6C}NLpskfsu|Gj+2pTRB8-&ZW!9tI>=vyUZd)h{$x7NOnL`{w zq+|2R%6T<`m22@9VpN}_<-tJr9rdsZ?t|}sR3a47LsHg$l1os{OIaIMUW0F35@XT7 zOD_+4#povcbV&(zp(?n#!*=-6r{iEK{mW1xxPoN^*MWsmK7G=V1CyTALtp-Ajnlay zrDLu(la&3Jux)&2QIH17s#BfQcR5zxz2UrqZC8A)Ib}yXNi5WRu?K`)62TNxhO+b; zOS)y$k@U2|2Ov`Q2zB=9OyezgXx7oL&M47w8uCnIaU0)76!eF-szsZTNnF5j;ea)M zG{fjFQL-yQJVV0zoVlpT!Pz_Bo}2MBB1~mv)t)9R5Gt|M0oLUAa(OntzSwjwctZ3`6om3m(a$p2If2foQKUS7ilcTOe zNU2Ot^p~flf$^27ojDdfYZ^lS!KgP$hI0jA7D7lms+SjK6-<;Q_UMxseg&G=y#kgt zpZnnzK#f(&-OlpA7U#GSKQE(=mQFYnkr+(8xr5^Qvfw840ni2!YnrDY{o&$&-_zHO zg?&~buT@oAj&xO|6=M={$PJXPi)?19kXwj<g(8$Gq!s zfKvXpfPRSLGt&f;CvDj}X+$uJ2x0A{!pbMhrx{eC2NJfvI6V02{@N-SXdjYK^R%L2Z@Cx}oL>2(91KGCz0P{BrB=$**afe|RHtw;F(U`tWcJAY z2v`bS`=L^_gM${Spv6MB=?*&SziHx}u53j@dS)Ozxp`LDZ zR$@vGjTe@!w^u3qeq-mX#jjM!=H0(Z3n*TDYsZcQtXH2t)kaJK=klvE_}#==87sxa1z{vD1e2&t+@wLznK#PW?f z*Ngv#ZNJRsJe_CvWFp{~6Y*ggnH{A%+Ok&s3m>wbg#$0Pq#FkYHPyP8x2{e7n+#LT$k{92R0V`=P3J0aUFoQVm$X%x7!}fmYR*nu5GV zfpc5n=R=bJ$e%UiHaS05FDq;R@I1s(?pySPt}y8+OfEH$GCzbSa~?>0Sv1Y(hfHhz z;~Ec{;FA%4DDpETE&?4|?9Y9ivJTz|F_llGJXW1i8ti@|HdrCQsG2NBUDyWh!vBF* z(5GD|sd!W(!MA@-`=-34Of5!PqAfDk!r|W2F>IdkLNIZ&dAP9To+B&4Xpy7jAN+H` z?C67IL$|ar(&EZ_e2zOVV*S69)1$$|N^X){`is|T`B$2ez9B|!pl-kHnG*|=&eAgp z(t>geKK>r50tZo_F(EnlxERUx7NZT4an-%wK^2|MY`57|oZHST9hWLMIKaRc%bGBt zAvdvMx5-SiIk1JfL*(`mNst~R=V@}l(ciM>h!iwIB`UClUP zCKi@7MW*P_4!j9okG{8>oL&Z$I=Ybm{VI)G$UL|LMhk@*i^kZ(T|+G+O37 zNY}(RAPoWJ^CojrR4~YM_7bTXuh|XGeGXwhNGio_#$g9tvVR(?&Y`Sg`XBkSG+*9A zV#(tfW;h*LjEX!U@eRhJRnN$XbX?{`=*E5aDZCdHQ*iHWI(Y8NE@E#9S4enRlC@;8 z&?*dh*|ILJvG#cVwP};RF~zdir}^479vHC_y4O(92SB#2?<2h~Oi)dIJHyr(z>RU4 z4!Uu%FXRN+QY_2xFwep`FjTKm_dzL{=Ny>7F&u_B(Jqcxg5D9Bx^1i`QJx z5E<)8_^Fb@T!WIIg>!ff31qo>QQrOD^hn<%0wB-UJpFvAy97Iwy&`T*VNBnIjGk2k z(M)5OWidHH@hVb#V_8STjH$X@27wc7)YViLL^n%ICoU}oIr|WzzdHVP0}$@>zPQdS zF}iMtjXZLP$pEeZZ79Uzaao9+pRxJJ)c%s$OZZ>kt(`3ULbp?bqvCOiYhT zYoS?*3K*I9N&Y(Rfz-xDpS>E9vi*Hn;PUqGe8Hj`Y#Dh=nALLJlJ-tLnE|p)lVw?c z;f#O!o~=zor%m-0=~%HPf0hIVetYS~8HW4k(qx!-=_rj2yaO6#j)5C>v3j*pT|Lsj z;J|=_EPJs=mUyAUrsAkJ{A%0hV1F_P<)!mInAPrmI|gA6jr|3Rs)CPxH;SI`rG}9= zOg|qt)`bjmii4@HcLPprpCy~i$=6IvQD2D-&v{gTRy-4XqezWVczrF(EI&`dTfwA1 zVugt-Y_ZukZdK~-Ef!{)sDrvYr9?-U2t&rtU2t~Om?628mv-)@x2_lgpo*4?FNccG zuNs|JJZDahF>ve27?VV1y$3gP;rHL?N=??7C|`+p^z>mMJN{p=Ylfj2435y^l9+JObomw2IYyK-df z;*shcRS^aDye6FmR9*BdpMX^!S(hRoub@C5I1Jz^j)`W_41Ne+Qlfjmhp<_>-!*gW z&3q2(z;dCma+!VvdfZ{S(oG5DkCnwJRC>Ac0E=V8Hz z_~a^qs`Cy&HQ!N9?-*P0P)$3%;_6=$?;i&y~@=es3IoxyizE0s-=t zWlW;iBbX{8?|Ie$dYv;{=OWo=3Lm4e`nzvh=%7=?J|H{-N5#>kJRWz5=tjyvrparf znkC|sOX3wbMh$Te3dqkdPs<;W^~WT z-a}a~gWLCD+bl~VB_1cYFIserS5-VY{>JwQsY1>V3~0*rz)$99vR~TOtcdUP9l z9{y7c*jl8%im;&|gcF1iw2?5BXn=^42skn3d(UB_Y4KTD2kjL*y~1tpB^7iHIz$*3I+sM3 zgxbmeF!DxR3o{)qrd>Vc1(-T=*4)0LAm<2VBgx{~UEDg8iu-RI#I9-0Ffni8<|c?L z+}E~AOehCaX3__=7UBE_uuTn{J&0pfy_lVXQ(dX;VPw8>KswVWbmg0jgfjj|P9{!p zM*}_2M853N7-^{KTV&MyV)e- zcu#evQ}zM6gn2=T3saH#b-g(lNs-=l#Iv`&(tSSwG~Ove<>lptBR%tq?-S{ zIMCg`$k^p0UT7mJ0yP26?hgPXXZ;Os@Mt!Td6yjMl=`_O%=zWSM$e$P@PD?#AU5R**qx&5DT7)FI6e9$Dya zcw0eT<~bJ}ylt&hUZCz~LL8=NBX*9C^d`EIytLv4P+n>8iG-{x@j0(B?Nt$mrVpM` z3Bm~wI`Te$3Ar&QlP1o>Gbsks>Oan;C?seYJ}W{pnRqbQyL@2zdKVts3}aNDsT)BI z4+cYd7%=nGxt{K>QiUWEhlGfb;U&VyH$8%{KsylrOYIU24>F6es`jLQIK$nqxUGcF zD%==z2pyf%JUgr*2y8OhAO&af@}EiSzzICHIc95>zD7Mk@s-w$5?j zj5~nSzn3@cb5{d<*gQD;*z-`ItTD$2{0B@-4bjPtzynpN0b0B?4V0skvh)~Gj3{-? zJRJb~{rrOUye{QjN^Rju=?{Sqj){8Aid^@#NbKz>6!ZTCsy1!CA=%2HtoOu;TPAdVAV@7J9`5WRx#>_~&gPV@;h94!1$jp$=MaM;A@M=LjbVRWV<$abbfGB$zT9#tnBC zs}$c7G4drdWL()f8Q<@w`ojr&G-sLYf&cA^r`BUfeNJVcki>qzu5);;MpvB$-1$)5 zyUz{Gx2?Q?)~V>>Z|bI9eMKlkgY9WG)*Rsayf`v*N~4sI4OXSZt6OCuc=ze`qu})R z7ym`{o$7MJOI&t;d!$v-40HCC!tFU?Yh-xTS83Qmf=Kek*rBUbR4Sx%>Mmo6D2-=~ zz|s~pWY8o3-`xUd@5jxyr9)|LC&QDgjfL6CAd$K4**HM4&}3G+RSM$L<>Cp|uhiD` zb6q@6$K)O_Lb`mC7Opb69M?FI5l6r&qnz%WBli{qF0jWNyAA!Yw%~-Kkfv^{f2d%k z6T&^AAB@B-XwwUJ7%tg0hKLeR&G=NyLr1?93?zl7tQMi7I*bdu>nqdsP#;rA+I6BE zhWaa|g?k7qBG!I8IHTYX?~b(4O3YfLIf^fwaNuu#P`T%(>CX}jqXA?%Ribt+*%OAE zIYjE{Cp$u5FJYIlEL4R5L^CVH*J}Na`Ow&(FL$d`5`YyX!)1;3A}*{?<*CLm)Bk)L$!#vWt2X(i0p07cy1hM6J^hMpIl*)I*`b{f>KzT6>k^DxAPg&LWGwzvDac zvNv1f>Nlff0YQxE8`}pI63i1UDx@TM6cQ7M7`%5i1FAE={Wd&M9KPgN+}&x;D~Zkz zC?%NRvueA^Jex$4L8iQZ$sMYoo%VWV70E z`$oW9sD(rYiwZ{~S3p*skP{QX!v_v%a2ZQMnN&&RYIISyTE#LT&CCGKd9xtZOgNZYRTrsIF^h{z#-`3_QBF zw`I&J@<+{>+^+MTK0c57B0Dop5K{zGszH3q!$RT6G4GzK< zvz;i29jkz)a{Cagti7I%_P*Ot3z3KFwHff&HCHC?R<$oi7+=tj7Nc4Vk~=DDFSUC! zEMW2{b^XgI$uDQ$_cY+Y-ZY%a6Ud;pa~uF<5^T4^PAkZdB>-W84RNv$$uWcXt_S!` z_HY8mG(<{2qP3G5Vv$lfjcm(ecm_A0oc3!3+!l=DKB8bgVKK22=IQXEwY;ytt3-C( zDG5E*|Dak?fd|PQei`3*{I+``1;wi=H03J4?7;BlOzP6w+U&f;eY?Raqavu`H9$Ck z8@cU0O#eOwb)-oa8xS+7=py~}f(L39etZ)}WF4gNYTU#PLG_dQv$(SX`khiCXoFjb zTpe(m<~p!vq)d}?sQK89=C_uIKDw;)K$wt-5emOea7_6n zBMVp1;t&ex2NeG@{VH;ymYZ%9*(8RZe^%F^E0rqK$9yR{eMxUeQ z#LrWvxWXwON?ac@x$52_&F3{qj*Zt>QWnV-1HG;t!RC?f1X3(J@xoKP>9% zKb648N*CPF5Zu_JY=)r?_TdM9@?+Cgi1<=5h^yN$aC1JB% z`KMZyJ7^#gCV)!BT$)GY6jV44Ecl3UD>zeC#T|N3CddfDq1B2^LQ<@WFFDun39r1> zH$1||Pn;F&J|F5MCt(%SQ&j;8sJh*kVV=;G%H$DSJSrIe!X^jjqpE)Vss{{;HMtBH zaDrLzNAr+uEBE;!gGCz=H%knv?+&)`uA4_^Y%#?pYe8W>RCBO6W*h!a*`Uh|pMJP; zwL9U>M-LxiQf4Y7YA&6C{<#Iu>neRI9d7xPh2JH}Oaz8;%9^1%qfCTBt2qN3Ta+WW+1HD$R6X=JR12x8`MoOc{S3qxfL0qc+aJaC{__@5c+Bw_T1# zeJApG94Ldm9~xNvxzV0H-Lj^^M_Z+@h%zhL*0bGrYMHoiKRkj~mZ#6X$BkzEn5d7w ztmy(h+%l(;4D(kJAD%icGD_o%Ecla;@s@&fk*1y2{eu3xz9lMnh``Q>=AMj~R~{$! zh@?-o`BT?%s2}oAU2dB-maCfr21(3>#?@ZhkBNV>&oJIpbqgc1rmOs>gjNCk(1Xk{ zgM}p07%bTscAE0I-a4myNJ;YnA2(F6uPJi8oNnb=ZhzRMu|o+H!=IZ z8j*?-B={pgoBlhVB}G(z{JrS!xN^eq&+dxw$I8JiH`K6~dZneZlL_(=gVf;1!U;6@ zGXu+Z+*T?8Zs^wYs%fF86RBS{Cqg}V!4UvkOF?iPARG~Becf6QOJmslu#7A=&|Otf z!)+k7IofK3MdCQ=$zi8BZO>hHec(NxDaVP)GNyWw7THY+vbSMc&n@eAm_;H-u?;!NzfH zQsZ09>)wWITxP^!Z;#pj596g9zGuBBP<{pXdGq_9&!|aWg3dhd*B9I@Tzxg-oUo*k zD3sY@_cYO1z4#~AZPG2a=mfS ze4k(qr>Zg>V25srSA@<4oru&i#!qGtNep(3p{YkoQJ-But`qejcJL!sjMR^bLXFeR zK($QivJl?g7Mm=FNVqw}gfLN0)eA4LhD%%1?Q6-r)3qlOeu|#utOqUW9*p(gY~`=; z@3q3eOcutdP+U?%@NUU;q6#`1mIfBz21}jS{mN;nup@%&5AVDOkd40i*2lz-Q6_dS z@_6qE}%CefCJ=;oeYs(&!a9g^QY#xs1g>JcMf!+y1 zc(=VabC)wwQ9Y|Y(U%=o>CgE{A>T`;W7whH)0XuuH6}~+Z=Y++`KN9F@N{C=S`b7> zBb!%a9Id|(k}h(RKI0h~kTCoOAK`(r;qO*%jJSDo%DlQmTv}qfc|-A^2$wP-P*D#n zr?y4Ee*tM2YvnU>LAO-JH=Zs^e=J1>Xt*h3j~Lv^AUc4pQi7Si*H#>d=U$ND$0vyd z8HF@K+x5!mc?ZI<;FphkaOIs}Z2AoY?1~Kj3v72F8sS&0U9(bcYRNaVul|UTB1bN` zp!3$-8t89Cg;Qav`GF)qAHO~lqIDn?TRUf>g`)yg+=j9JRh;o3xW!M;&~i*lgMam8 z3zb+eJNP$=o+e**-05Txn8=3@GMp~|;DNY@W%zV1%10zoLTX!F%5hnEy&iq!-wteh zIZe!zfyzuou6&T&-!>}i9Fx{Z;}{ZjQu<1KHMdlij^n@-<>aRUieq?hiEdQ4w>qY` z8V6kB%nETlY;mUM)LD`kOwJQ_Eo!^iay}K&b2L%F#t0jj_q7-D+~*jin91ZmRZSVv z;a!whLc^EdSHAR1p0AeV#onnN|5o@-0c$h7$h8YN$@OWY=y6Q+7rB*nduIL=sD+m1 z2eSjQQk8$+wSoHtTs%eRzsTw7&eYL)oEjL#g|bR$zJTSGxKms!`f?pQUFLo&%4H|x zC2p`0l@Y`yYJXTrn~rnmA$VIDH=Q5-aun%sq*fT=SckKi^Kw|wDA|&Z_Xp!1os)EM z#tk;pZf@yK54A%*{-v8Y=)gAq-3T!qG^APh3Zn&de$=h!!-$Uou%hmx-WOxi=g%C<)0)UO7!$1QS7gh@c)x$F-}-q zvPGUUiM*9{-xYg?^HYq%S&T+lxIFw&lj+tM+-ENVXmf=8m+?-xi=p?goiBc=(>Bri zfbYmva~P^MyAnbmjlkWq8M^+iMy5*^+$2+2E@f*DaEh!lw(rdv+!Ly zKrZByF__zbNh)N%|533VX-2Ofgopd4vvzaXq0MP+62+hnX&HPB?Jw|ipdU-d&TGvy z{Yf}nU0CgcvAXHe2)5=Tecyz2y>GFz_EQ1O%86MolSkm;^yFYQY%M zV~|yJa9_(l15T|g31SkO6f)01s%|$_yx}Tjz%!kE0i81Xa2a+EH0r1(6_Lhb5#&oq z#jET%W=s4*@_C@sT(@$IzbqFII!Q8%CD%}SQfVV@m!gu(b=d*7s-jy!fv8gSGG{i=VbB<`R$vSy`t7~NM-FL$sspT3lU zmdy3Y4N$fAT-h8>o8qr&Ik8aeY@tz3d*aBc@g^xAAyviXY48`p~`dxU7#?Zhdnn zI&OuJ;izAC4!g({cVPS{-jJpk23JSjF$MoDLQw>L`hTRQEM9?hCZ8!od0h1svO=!i zwOIYW*Z;MsVA~gfYcB+RZrU~N<6>SDVR|y*Aeus8Q^BY3^HHOEx((=)UzfdDZFbG@ z)EKtrp+t^n1=yG(`Qv=?6+>QXKLVgboj$DdUmeTD*OiC4t=3ysAJ(o+T1W}AwQdW~ zoy0)M3Ud10m)u&cBVHIPwnBpBT2TDlleal6D*Sdl1krx59ZR{!8I4ZnR8*Y_Je=X< zwtv0xX`yq%wpZIXd?zgF?PoPmUXvKEc3msi#QNkRv&U$ya&`cAG*}}`A>ZYxzv0gA^!^Q)V`HvBQ=g!T zXI?y<9rA#_mc+!Cfl}`s7zWIx=8U|%1N!Oz+hF5-QGR2x2f=OM^nX%eH}WnY#1A>z zB&|R5_nbz9SR6ze$HEVd9VK|vCwfA-o>D7!fL*JODb8Xn_M_PaFL#aFwie8=McZ+$ zFXT5`B(4tD=JJyD`96NaQqDjFd`SwHHPf4pOF>(Ky6?aAdAVW9N@%`#$-LL@7txXr zMP-E}U;ll6x(+sP%kH$)$j7R l#tLE?lm8dl^ZR+EtijHx&pUT&EE5$+OHE(3QP~0h{{X35F^B*F literal 0 HcmV?d00001 From 3d5b140c3d9b279c83355d7c8c5f6bdc6a5b1330 Mon Sep 17 00:00:00 2001 From: jerbob92 Date: Mon, 27 Apr 2020 18:28:21 +0200 Subject: [PATCH 24/25] Fix URLSessionImplementations file upload (#6043) * Fix URLSessionImplementations file upload * Generated petstore --- .../URLSessionImplementations.mustache | 45 ++-- .../petstore/swift5/default/Package.swift | 4 +- .../Classes/OpenAPIs/APIHelper.swift | 17 +- .../Classes/OpenAPIs/APIs.swift | 14 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 56 ++--- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 48 +++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 26 +-- .../Classes/OpenAPIs/APIs/UserAPI.swift | 36 ++-- .../Classes/OpenAPIs/CodableHelper.swift | 2 +- .../Classes/OpenAPIs/Configuration.swift | 6 +- .../Classes/OpenAPIs/Extensions.swift | 20 +- .../Classes/OpenAPIs/JSONDataEncoding.swift | 2 +- .../Classes/OpenAPIs/JSONEncodingHelper.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 7 +- .../Models/AdditionalPropertiesClass.swift | 12 +- .../Classes/OpenAPIs/Models/Animal.swift | 4 +- .../Classes/OpenAPIs/Models/AnimalFarm.swift | 1 + .../Classes/OpenAPIs/Models/ApiResponse.swift | 4 +- .../Models/ArrayOfArrayOfNumberOnly.swift | 6 +- .../OpenAPIs/Models/ArrayOfNumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/ArrayTest.swift | 6 +- .../OpenAPIs/Models/Capitalization.swift | 6 +- .../Classes/OpenAPIs/Models/Cat.swift | 4 +- .../Classes/OpenAPIs/Models/CatAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/Category.swift | 4 +- .../Classes/OpenAPIs/Models/ClassModel.swift | 3 +- .../Classes/OpenAPIs/Models/Client.swift | 4 +- .../Classes/OpenAPIs/Models/Dog.swift | 4 +- .../Classes/OpenAPIs/Models/DogAllOf.swift | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 6 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 1 + .../Classes/OpenAPIs/Models/EnumTest.swift | 6 +- .../Classes/OpenAPIs/Models/File.swift | 3 +- .../OpenAPIs/Models/FileSchemaTestClass.swift | 4 +- .../Classes/OpenAPIs/Models/FormatTest.swift | 4 +- .../OpenAPIs/Models/HasOnlyReadOnly.swift | 4 +- .../Classes/OpenAPIs/Models/List.swift | 6 +- .../Classes/OpenAPIs/Models/MapTest.swift | 14 +- ...opertiesAndAdditionalPropertiesClass.swift | 8 +- .../OpenAPIs/Models/Model200Response.swift | 5 +- .../Classes/OpenAPIs/Models/Name.swift | 5 +- .../Classes/OpenAPIs/Models/NumberOnly.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 4 +- .../OpenAPIs/Models/OuterComposite.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 1 + .../Classes/OpenAPIs/Models/Pet.swift | 4 +- .../OpenAPIs/Models/ReadOnlyFirst.swift | 4 +- .../Classes/OpenAPIs/Models/Return.swift | 5 +- .../OpenAPIs/Models/SpecialModelName.swift | 6 +- .../OpenAPIs/Models/StringBooleanMap.swift | 8 +- .../Classes/OpenAPIs/Models/Tag.swift | 4 +- .../OpenAPIs/Models/TypeHolderDefault.swift | 6 +- .../OpenAPIs/Models/TypeHolderExample.swift | 6 +- .../Classes/OpenAPIs/Models/User.swift | 4 +- .../OpenAPIs/URLSessionImplementations.swift | 203 ++++++++++-------- 57 files changed, 416 insertions(+), 288 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index de8b6254db..6717283868 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -488,8 +488,8 @@ fileprivate class FileUploadEncoding: ParameterEncoding { } var body = urlRequest.httpBody.orEmpty - - body.append("--\(boundary)--") + + body.append("\r\n--\(boundary)--\r\n") urlRequest.httpBody = body @@ -507,15 +507,24 @@ fileprivate class FileUploadEncoding: ParameterEncoding { let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent - + + // If we already added something then we need an additional newline. + if (body.count > 0) { + body.append("\r\n") + } + + // Value boundary. body.append("--\(boundary)\r\n") - body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") - body.append("Content-Type: \(mimetype)\r\n\r\n") + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + // Separate headers and body. + body.append("\r\n") + + // The value data. body.append(fileData) - - body.append("\r\n\r\n") urlRequest.httpBody = body @@ -527,14 +536,24 @@ fileprivate class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - - body.append("--\(boundary)\r\n") - body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") + // If we already added something then we need an additional newline. + if (body.count > 0) { + body.append("\r\n") + } + + // Value boundary. + body.append("--\(boundary)\r\n") + + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. body.append(data) - - body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest diff --git a/samples/client/petstore/swift5/default/Package.swift b/samples/client/petstore/swift5/default/Package.swift index 96dfff54ed..79f6f81887 100644 --- a/samples/client/petstore/swift5/default/Package.swift +++ b/samples/client/petstore/swift5/default/Package.swift @@ -14,7 +14,7 @@ let package = Package( // Products define the executables and libraries produced by a package, and make them visible to other packages. .library( name: "PetstoreClient", - targets: ["PetstoreClient"]) + targets: ["PetstoreClient"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. @@ -26,6 +26,6 @@ let package = Package( name: "PetstoreClient", dependencies: [], path: "PetstoreClient/Classes" - ) + ), ] ) diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift index 2000700968..d94614b34f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIHelper.swift @@ -7,7 +7,7 @@ import Foundation public struct APIHelper { - public static func rejectNil(_ source: [String: Any?]) -> [String: Any]? { + public 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 @@ -20,17 +20,17 @@ public struct APIHelper { return destination } - public static func rejectNilHeaders(_ source: [String: Any?]) -> [String: String] { + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { return source.reduce(into: [String: String]()) { (result, item) in - if let collection = item.value as? [Any?] { - result[item.key] = collection.filter({ $0 != nil }).map { "\($0!)" }.joined(separator: ",") + 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)" } } } - public static func convertBoolToString(_ source: [String: Any]?) -> [String: Any]? { + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { guard let source = source else { return nil } @@ -46,15 +46,15 @@ public struct APIHelper { } public static func mapValueToPathItem(_ source: Any) -> Any { - if let collection = source as? [Any?] { + if let collection = source as? Array { return collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") } return source } - public static func mapValuesToQueryItems(_ source: [String: Any?]) -> [URLQueryItem]? { + public 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? [Any?] { + 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 { @@ -68,3 +68,4 @@ public struct APIHelper { return destination } } + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index a5c2d605df..c5d1b9b42d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -9,15 +9,15 @@ import Foundation open class PetstoreClientAPI { public static var basePath = "http://petstore.swagger.io:80/v2" public static var credential: URLCredential? - public static var customHeaders: [String: String] = [:] + public static var customHeaders: [String:String] = [:] public static var requestBuilderFactory: RequestBuilderFactory = URLSessionRequestBuilderFactory() public static var apiResponseQueue: DispatchQueue = .main } open class RequestBuilder { var credential: URLCredential? - var headers: [String: String] - public let parameters: [String: Any]? + var headers: [String:String] + public let parameters: [String:Any]? public let isBody: Bool public let method: String public let URLString: String @@ -25,9 +25,9 @@ open class RequestBuilder { /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. /// If you need to get the request's progress in older OS versions, please use Alamofire http client. - public var onProgressReady: ((Progress) -> Void)? + public var onProgressReady: ((Progress) -> ())? - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { self.method = method self.URLString = URLString self.parameters = parameters @@ -37,7 +37,7 @@ open class RequestBuilder { addHeaders(PetstoreClientAPI.customHeaders) } - open func addHeaders(_ aHeaders: [String: String]) { + open func addHeaders(_ aHeaders:[String:String]) { for (header, value) in aHeaders { headers[header] = value } @@ -60,5 +60,5 @@ open class RequestBuilder { public protocol RequestBuilderFactory { func getNonDecodableBuilder() -> RequestBuilder.Type - func getBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 5bbf323f82..bb3ae71782 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class AnotherFakeAPI { /** To test special tags @@ -15,7 +17,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 134d6aea41..d1d81faa33 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeAPI { /** @@ -14,7 +16,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?,_ error: Error?) -> Void)) { fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -49,7 +51,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?,_ error: Error?) -> Void)) { fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -84,7 +86,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?,_ error: Error?) -> Void)) { fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -119,7 +121,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -154,7 +156,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -190,7 +192,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -229,7 +231,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -279,7 +281,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEndpointParametersWithRequestBuilder(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(apiResponseQueue) { result -> Void in switch result { case .success: @@ -316,7 +318,7 @@ open class FakeAPI { open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "integer": integer?.encodeToJSON(), "int32": int32?.encodeToJSON(), "int64": int64?.encodeToJSON(), @@ -335,7 +337,7 @@ open class FakeAPI { let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -424,7 +426,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -452,19 +454,19 @@ open class FakeAPI { open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "enum_form_string_array": enumFormStringArray?.encodeToJSON(), "enum_form_string": enumFormString?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), - "enum_query_string": enumQueryString?.encodeToJSON(), - "enum_query_integer": enumQueryInteger?.encodeToJSON(), + "enum_query_string_array": enumQueryStringArray?.encodeToJSON(), + "enum_query_string": enumQueryString?.encodeToJSON(), + "enum_query_integer": enumQueryInteger?.encodeToJSON(), "enum_query_double": enumQueryDouble?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -490,7 +492,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -516,13 +518,13 @@ open class FakeAPI { open class func testGroupParametersWithRequestBuilder(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil) -> RequestBuilder { let path = "/fake" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "required_string_group": requiredStringGroup.encodeToJSON(), - "required_int64_group": requiredInt64Group.encodeToJSON(), - "string_group": stringGroup?.encodeToJSON(), + "required_string_group": requiredStringGroup.encodeToJSON(), + "required_int64_group": requiredInt64Group.encodeToJSON(), + "string_group": stringGroup?.encodeToJSON(), "int64_group": int64Group?.encodeToJSON() ]) let nillableHeaders: [String: Any?] = [ @@ -543,7 +545,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testInlineAdditionalProperties(param: [String:String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -560,7 +562,7 @@ open class FakeAPI { - parameter param: (body) request body - returns: RequestBuilder */ - open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String: String]) -> RequestBuilder { + open class func testInlineAdditionalPropertiesWithRequestBuilder(param: [String:String]) -> RequestBuilder { let path = "/fake/inline-additionalProperties" let URLString = PetstoreClientAPI.basePath + path let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: param) @@ -580,7 +582,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -601,14 +603,14 @@ open class FakeAPI { open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { let path = "/fake/jsonFormData" let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "param": param.encodeToJSON(), "param2": param2.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 48cfe7187b..d21c4a49d4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -7,6 +7,8 @@ import Foundation + + open class FakeClassnameTags123API { /** To test class name in snake case @@ -15,7 +17,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?,_ error: Error?) -> Void)) { testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 0552d4a6c1..496da91171 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class PetAPI { /** Add a new pet to the store @@ -15,7 +17,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -55,7 +57,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -82,8 +84,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let nillableHeaders: [String: Any?] = [ "api_key": apiKey?.encodeToJSON() @@ -111,7 +113,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByStatus(status: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -135,8 +137,8 @@ open class PetAPI { open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByStatus" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "status": status.encodeToJSON() @@ -154,7 +156,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?,_ error: Error?) -> Void)) { findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -178,8 +180,8 @@ open class PetAPI { open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { let path = "/pet/findByTags" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ "tags": tags.encodeToJSON() @@ -197,7 +199,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -224,8 +226,8 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -240,7 +242,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -281,7 +283,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -309,14 +311,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "name": name?.encodeToJSON(), "status": status?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -333,7 +335,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -361,14 +363,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "file": file?.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -385,7 +387,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?,_ error: Error?) -> Void)) { uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -413,14 +415,14 @@ open class PetAPI { let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let formParams: [String: Any?] = [ + let formParams: [String:Any?] = [ "additionalMetadata": additionalMetadata?.encodeToJSON(), "requiredFile": requiredFile.encodeToJSON() ] let nonNullParameters = APIHelper.rejectNil(formParams) let parameters = APIHelper.convertBoolToString(nonNullParameters) - + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index a8a83eda39..3848eda85a 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class StoreAPI { /** Delete purchase order by ID @@ -15,7 +17,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -39,8 +41,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -54,7 +56,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String:Int]?,_ error: Error?) -> Void)) { getInventoryWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -74,14 +76,14 @@ open class StoreAPI { - name: api_key - returns: RequestBuilder<[String:Int]> */ - open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String:Int]> { let path = "/store/inventory" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) - let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + let requestBuilder: RequestBuilder<[String:Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) } @@ -93,7 +95,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -117,8 +119,8 @@ open class StoreAPI { let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -133,7 +135,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?,_ error: Error?) -> Void)) { placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 505ed1b0c5..546166841d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -7,6 +7,8 @@ import Foundation + + open class UserAPI { /** Create user @@ -15,7 +17,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -52,7 +54,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -88,7 +90,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -124,7 +126,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -148,8 +150,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -164,7 +166,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?,_ error: Error?) -> Void)) { getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -187,8 +189,8 @@ open class UserAPI { let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() @@ -204,7 +206,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?,_ error: Error?) -> Void)) { loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result -> Void in switch result { case let .success(response): @@ -226,11 +228,11 @@ open class UserAPI { open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { let path = "/user/login" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + var url = URLComponents(string: URLString) url?.queryItems = APIHelper.mapValuesToQueryItems([ - "username": username.encodeToJSON(), + "username": username.encodeToJSON(), "password": password.encodeToJSON() ]) @@ -245,7 +247,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { logoutUserWithRequestBuilder().execute(apiResponseQueue) { result -> Void in switch result { case .success: @@ -264,8 +266,8 @@ open class UserAPI { open class func logoutUserWithRequestBuilder() -> RequestBuilder { let path = "/user/logout" let URLString = PetstoreClientAPI.basePath + path - let parameters: [String: Any]? = nil - + let parameters: [String:Any]? = nil + let url = URLComponents(string: URLString) let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() @@ -281,7 +283,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - parameter completion: completion handler to receive the data and the error objects */ - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?,_ error: Error?) -> Void)) { updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result -> Void in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift index ef971ebadc..01b28a4bd4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/CodableHelper.swift @@ -45,4 +45,4 @@ open class CodableHelper { open class func encode(_ value: T) -> Swift.Result where T: Encodable { return Swift.Result { try self.jsonEncoder.encode(value) } } -} +} \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift index 627d9adb75..f171525e43 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Configuration.swift @@ -7,10 +7,10 @@ import Foundation open 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. @available(*, unavailable, message: "To set a different date format, use CodableHelper.dateFormatter instead.") public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" - -} + +} \ No newline at end of file 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 93ed6b90b3..6e279679c6 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Extensions.swift @@ -108,24 +108,24 @@ extension String: CodingKey { extension KeyedEncodingContainerProtocol { - public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { var arrayContainer = nestedUnkeyedContainer(forKey: key) try arrayContainer.encode(contentsOf: values) } - public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T: Encodable { + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { if let values = values { try encodeArray(values, forKey: key) } } - public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T: Encodable { + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { for (key, value) in pairs { try encode(value, forKey: key) } } - public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T: Encodable { + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { if let pairs = pairs { try encodeMap(pairs) } @@ -135,7 +135,7 @@ extension KeyedEncodingContainerProtocol { extension KeyedDecodingContainerProtocol { - public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T: Decodable { + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { var tmpArray = [T]() var nestedContainer = try nestedUnkeyedContainer(forKey: key) @@ -147,8 +147,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T: Decodable { - var tmpArray: [T]? + public 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) @@ -157,8 +157,8 @@ extension KeyedDecodingContainerProtocol { return tmpArray } - public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T: Decodable { - var map: [Self.Key: T] = [:] + public 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) { @@ -177,3 +177,5 @@ extension HTTPURLResponse { return Array(200 ..< 300).contains(statusCode) } } + + diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift index b79e9f5e64..08f1ef334d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONDataEncoding.swift @@ -41,7 +41,7 @@ public struct JSONDataEncoding { } public static func encodingParameters(jsonData: Data?) -> [String: Any]? { - var returnedParams: [String: Any]? + var returnedParams: [String: Any]? = nil if let jsonData = jsonData, !jsonData.isEmpty { var params: [String: Any] = [:] params[jsonDataKey] = jsonData diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift index 02f78ffb47..314f1eff1f 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift @@ -9,8 +9,8 @@ import Foundation open class JSONEncodingHelper { - open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { - var params: [String: Any]? + open class func encodingParameters(forEncodableObject encodableObj: T?) -> [String: Any]? { + var params: [String: Any]? = nil // Encode the Encodable object if let encodableObj = encodableObj { @@ -27,7 +27,7 @@ open class JSONEncodingHelper { } open class func encodingParameters(forEncodableObject encodableObj: Any?) -> [String: Any]? { - var params: [String: Any]? + var params: [String: Any]? = nil if let encodableObj = encodableObj { do { @@ -41,5 +41,5 @@ open class JSONEncodingHelper { return params } - + } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index b0bfb11597..290c7f35e4 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -10,11 +10,11 @@ protocol JSONEncodable { func encodeToJSON() -> Any } -public enum ErrorResponse: Error { +public enum ErrorResponse : Error { case error(Int, Data?, Error) } -public enum DownloadException: Error { +public enum DownloadException : Error { case responseDataMissing case responseFailed case requestMissing @@ -30,6 +30,7 @@ public enum DecodableRequestBuilderError: Error { case generalError(Error) } + open class Response { public let statusCode: Int public let header: [String: String] @@ -43,7 +44,7 @@ open class Response { public convenience init(response: HTTPURLResponse, body: T?) { let rawHeader = response.allHeaderFields - var header = [String: String]() + var header = [String:String]() for (key, value) in rawHeader { if let key = key as? String, let value = value as? String { header[key] = value 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 1af0315359..28ca8377b8 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 @@ -7,17 +7,19 @@ import Foundation -public struct AdditionalPropertiesClass: Codable { - public var mapString: [String: String]? - public var mapMapString: [String: [String: String]]? +public struct AdditionalPropertiesClass: Codable { - public init(mapString: [String: String]?, mapMapString: [String: [String: String]]?) { + + public var mapString: [String:String]? + public var mapMapString: [String:[String:String]]? + + public init(mapString: [String:String]?, mapMapString: [String:[String:String]]?) { self.mapString = mapString self.mapMapString = mapMapString } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapString = "map_string" case mapMapString = "map_map_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 5ed9f31e2a..1050d79dbe 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 @@ -7,7 +7,9 @@ import Foundation -public struct Animal: Codable { + +public struct Animal: Codable { + public var className: String public var color: String? = "red" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift index e09b0e9efd..e7bea63f8e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift @@ -7,4 +7,5 @@ import Foundation + public typealias AnimalFarm = [Animal] 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 ec270da890..4d0393b9ba 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 @@ -7,7 +7,9 @@ import Foundation -public struct ApiResponse: Codable { + +public struct ApiResponse: Codable { + 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 6c252ed475..1363c96394 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 @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfArrayOfNumberOnly: Codable { + +public struct ArrayOfArrayOfNumberOnly: Codable { + public var arrayArrayNumber: [[Double]]? @@ -15,7 +17,7 @@ public struct ArrayOfArrayOfNumberOnly: Codable { self.arrayArrayNumber = arrayArrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayArrayNumber = "ArrayArrayNumber" } 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 e84eb5d650..6b8873730c 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 @@ -7,7 +7,9 @@ import Foundation -public struct ArrayOfNumberOnly: Codable { + +public struct ArrayOfNumberOnly: Codable { + public var arrayNumber: [Double]? @@ -15,7 +17,7 @@ public struct ArrayOfNumberOnly: Codable { self.arrayNumber = arrayNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayNumber = "ArrayNumber" } 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 d2140933d1..64f7c6d9db 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 @@ -7,7 +7,9 @@ import Foundation -public struct ArrayTest: Codable { + +public struct ArrayTest: Codable { + public var arrayOfString: [String]? public var arrayArrayOfInteger: [[Int64]]? @@ -19,7 +21,7 @@ public struct ArrayTest: Codable { self.arrayArrayOfModel = arrayArrayOfModel } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case arrayOfString = "array_of_string" case arrayArrayOfInteger = "array_array_of_integer" case arrayArrayOfModel = "array_array_of_model" 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 d1b3b27616..ddb669a590 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 @@ -7,7 +7,9 @@ import Foundation -public struct Capitalization: Codable { + +public struct Capitalization: Codable { + public var smallCamel: String? public var capitalCamel: String? @@ -26,7 +28,7 @@ public struct Capitalization: Codable { self.ATT_NAME = ATT_NAME } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case smallCamel case capitalCamel = "CapitalCamel" case smallSnake = "small_Snake" 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 7ab887f311..c4f6e0d488 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 @@ -7,7 +7,9 @@ import Foundation -public struct Cat: Codable { + +public struct Cat: Codable { + 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 a51ad0dffa..7b1d7e32be 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 @@ -7,7 +7,9 @@ import Foundation -public struct CatAllOf: Codable { + +public struct CatAllOf: Codable { + 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 eb8f7e5e19..3ec00f5ab1 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 @@ -7,7 +7,9 @@ import Foundation -public struct Category: Codable { + +public struct Category: Codable { + 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 e2a7d4427a..af030c3dd6 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 @@ -8,7 +8,8 @@ import Foundation /** Model for testing model with \"_class\" property */ -public struct ClassModel: Codable { +public struct ClassModel: Codable { + 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 00245ca372..0aae748c76 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 @@ -7,7 +7,9 @@ import Foundation -public struct Client: Codable { + +public struct Client: Codable { + 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 492c122800..198e28b94d 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 @@ -7,7 +7,9 @@ import Foundation -public struct Dog: Codable { + +public struct Dog: Codable { + 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 7786f8acc5..8ff49b2af2 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 @@ -7,7 +7,9 @@ import Foundation -public struct DogAllOf: Codable { + +public struct DogAllOf: Codable { + 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 9844e7c40e..e2d3fa04f9 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 @@ -7,7 +7,9 @@ import Foundation -public struct EnumArrays: Codable { + +public struct EnumArrays: Codable { + public enum JustSymbol: String, Codable, CaseIterable { case greaterThanOrEqualTo = ">=" @@ -25,7 +27,7 @@ public struct EnumArrays: Codable { self.arrayEnum = arrayEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justSymbol = "just_symbol" case arrayEnum = "array_enum" } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index d4029d73f8..c2c639ba32 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -7,6 +7,7 @@ import Foundation + public enum EnumClass: String, Codable, CaseIterable { case abc = "_abc" case efg = "-efg" 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 789f583e1d..a56e1f3638 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 @@ -7,7 +7,9 @@ import Foundation -public struct EnumTest: Codable { + +public struct EnumTest: Codable { + public enum EnumString: String, Codable, CaseIterable { case upper = "UPPER" @@ -41,7 +43,7 @@ public struct EnumTest: Codable { self.outerEnum = outerEnum } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case enumString = "enum_string" case enumStringRequired = "enum_string_required" case enumInteger = "enum_integer" 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 abf3ccffc4..773b53b2cb 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 @@ -8,7 +8,8 @@ import Foundation /** Must be named `File` for test. */ -public struct File: Codable { +public struct File: Codable { + /** 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 532f145793..83dc1148cf 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 @@ -7,7 +7,9 @@ import Foundation -public struct FileSchemaTestClass: Codable { + +public struct FileSchemaTestClass: Codable { + 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 20bd6d103b..bccd3f9fb1 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 @@ -7,7 +7,9 @@ import Foundation -public struct FormatTest: Codable { + +public struct FormatTest: Codable { + 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 906ddb06fb..566d71a35e 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 @@ -7,7 +7,9 @@ import Foundation -public struct HasOnlyReadOnly: Codable { + +public struct HasOnlyReadOnly: Codable { + 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 fe13d302cc..80cecab242 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 @@ -7,7 +7,9 @@ import Foundation -public struct List: Codable { + +public struct List: Codable { + public var _123list: String? @@ -15,7 +17,7 @@ public struct List: Codable { self._123list = _123list } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _123list = "123-list" } 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 4b6037f378..f0c02de95f 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 @@ -7,25 +7,27 @@ import Foundation -public struct MapTest: Codable { + +public struct MapTest: Codable { + public enum MapOfEnumString: String, Codable, CaseIterable { case upper = "UPPER" case lower = "lower" } - public var mapMapOfString: [String: [String: String]]? - public var mapOfEnumString: [String: String]? - public var directMap: [String: Bool]? + public var mapMapOfString: [String:[String:String]]? + public var mapOfEnumString: [String:String]? + public var directMap: [String:Bool]? public var indirectMap: StringBooleanMap? - public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?, directMap: [String: Bool]?, indirectMap: StringBooleanMap?) { + public init(mapMapOfString: [String:[String:String]]?, mapOfEnumString: [String:String]?, directMap: [String:Bool]?, indirectMap: StringBooleanMap?) { self.mapMapOfString = mapMapOfString self.mapOfEnumString = mapOfEnumString self.directMap = directMap self.indirectMap = indirectMap } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case mapMapOfString = "map_map_of_string" case mapOfEnumString = "map_of_enum_string" case directMap = "direct_map" 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 c3deb2f289..710e62a9b5 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 @@ -7,13 +7,15 @@ import Foundation -public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + +public struct MixedPropertiesAndAdditionalPropertiesClass: Codable { + public var uuid: UUID? public var dateTime: Date? - public var map: [String: Animal]? + public var map: [String:Animal]? - public init(uuid: UUID?, dateTime: Date?, map: [String: Animal]?) { + public init(uuid: UUID?, dateTime: Date?, map: [String:Animal]?) { self.uuid = uuid self.dateTime = dateTime self.map = map 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 b61db7d6e7..450a53b918 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 @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name starting with number */ -public struct Model200Response: Codable { +public struct Model200Response: Codable { + public var name: Int? public var _class: String? @@ -18,7 +19,7 @@ public struct Model200Response: Codable { self._class = _class } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case _class = "class" } 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 8ab4db44b7..6deb69fcd7 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 @@ -8,7 +8,8 @@ import Foundation /** Model for testing model name same as property name */ -public struct Name: Codable { +public struct Name: Codable { + public var name: Int public var snakeCase: Int? @@ -22,7 +23,7 @@ public struct Name: Codable { self._123number = _123number } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case name case snakeCase = "snake_case" case property 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 4d1dafcc2c..0c9ee2b7b9 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 @@ -7,7 +7,9 @@ import Foundation -public struct NumberOnly: Codable { + +public struct NumberOnly: Codable { + public var justNumber: Double? @@ -15,7 +17,7 @@ public struct NumberOnly: Codable { self.justNumber = justNumber } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case justNumber = "JustNumber" } 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 40c30cc860..ab0eac0b30 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 @@ -7,7 +7,9 @@ import Foundation -public struct Order: Codable { + +public struct Order: Codable { + 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 18c3a024f1..4a7d227104 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 @@ -7,7 +7,9 @@ import Foundation -public struct OuterComposite: Codable { + +public struct OuterComposite: Codable { + public var myNumber: Double? public var myString: String? @@ -19,7 +21,7 @@ public struct OuterComposite: Codable { self.myBoolean = myBoolean } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case myNumber = "my_number" case myString = "my_string" case myBoolean = "my_boolean" diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index c3b778cbbe..9e6b8d74e8 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -7,6 +7,7 @@ import Foundation + public enum OuterEnum: String, Codable, CaseIterable { case placed = "placed" case approved = "approved" 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 b9ce0e9332..a973071d6c 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 @@ -7,7 +7,9 @@ import Foundation -public struct Pet: Codable { + +public struct Pet: Codable { + 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 0acd21fd10..b2a6b7e2b8 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 @@ -7,7 +7,9 @@ import Foundation -public struct ReadOnlyFirst: Codable { + +public struct ReadOnlyFirst: Codable { + 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 c223f993a6..7e089dcee2 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 @@ -8,7 +8,8 @@ import Foundation /** Model for testing reserved words */ -public struct Return: Codable { +public struct Return: Codable { + public var _return: Int? @@ -16,7 +17,7 @@ public struct Return: Codable { self._return = _return } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case _return = "return" } 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 6e8650f76d..e890ef9525 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 @@ -7,7 +7,9 @@ import Foundation -public struct SpecialModelName: Codable { + +public struct SpecialModelName: Codable { + public var specialPropertyName: Int64? @@ -15,7 +17,7 @@ public struct SpecialModelName: Codable { self.specialPropertyName = specialPropertyName } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case specialPropertyName = "$special[property.name]" } 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 3f1237fee4..f65ae0623d 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 @@ -7,9 +7,12 @@ import Foundation -public struct StringBooleanMap: Codable { - public var additionalProperties: [String: Bool] = [:] +public struct StringBooleanMap: Codable { + + + + public var additionalProperties: [String:Bool] = [:] public subscript(key: String) -> Bool? { get { @@ -42,4 +45,5 @@ public struct StringBooleanMap: Codable { additionalProperties = try container.decodeMap(Bool.self, excludedKeys: nonAdditionalPropertyKeys) } + } 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 4dd8a9a9f5..a91b6061bc 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 @@ -7,7 +7,9 @@ import Foundation -public struct Tag: Codable { + +public struct Tag: Codable { + 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 a9e088808e..2d377c3edb 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 @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderDefault: Codable { + +public struct TypeHolderDefault: Codable { + public var stringItem: String = "what" public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderDefault: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" 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 dff4083ae4..e5eb92da69 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 @@ -7,7 +7,9 @@ import Foundation -public struct TypeHolderExample: Codable { + +public struct TypeHolderExample: Codable { + public var stringItem: String public var numberItem: Double @@ -23,7 +25,7 @@ public struct TypeHolderExample: Codable { self.arrayItem = arrayItem } - public enum CodingKeys: String, CodingKey, CaseIterable { + public enum CodingKeys: String, CodingKey, CaseIterable { case stringItem = "string_item" case numberItem = "number_item" case integerItem = "integer_item" 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 79f271ed73..f70328ca9e 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 @@ -7,7 +7,9 @@ import Foundation -public struct User: Codable { + +public struct User: Codable { + public var id: Int64? public var username: String? diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index a31860adfd..b31b84b500 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -14,7 +14,7 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { return URLSessionRequestBuilder.self } - func getBuilder() -> RequestBuilder.Type { + func getBuilder() -> RequestBuilder.Type { return URLSessionDecodableRequestBuilder.self } } @@ -23,18 +23,18 @@ class URLSessionRequestBuilderFactory: RequestBuilderFactory { private var urlSessionStore = SynchronizedDictionary() open class URLSessionRequestBuilder: RequestBuilder { - + let progress = Progress() - + private var observation: NSKeyValueObservation? - + deinit { observation?.invalidate() } - + // swiftlint:disable:next weak_delegate fileprivate let sessionDelegate = SessionDelegate() - + /** May be assigned if you want to control the authentication challenges. */ @@ -47,11 +47,11 @@ open class URLSessionRequestBuilder: RequestBuilder { - retry the request. */ public var taskCompletionShouldRetry: ((Data?, URLResponse?, Error?, @escaping (Bool) -> Void) -> Void)? - - required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + + required public 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 URLSession configuration. @@ -79,40 +79,40 @@ open class URLSessionRequestBuilder: RequestBuilder { May be overridden by a subclass if you want to control the URLRequest configuration (e.g. to override the cache policy). */ - open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String: String]) throws -> URLRequest { - + open func createURLRequest(urlSession: URLSession, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) throws -> URLRequest { + guard let url = URL(string: URLString) else { throw DownloadException.requestMissingURL } - + var originalRequest = URLRequest(url: url) - + originalRequest.httpMethod = method.rawValue - + buildHeaders().forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + headers.forEach { key, value in originalRequest.setValue(value, forHTTPHeaderField: key) } - + let modifiedRequest = try encoding.encode(originalRequest, with: parameters) - + return modifiedRequest } override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, Error>) -> Void) { - let urlSessionId: String = UUID().uuidString + let urlSessionId:String = UUID().uuidString // Create a new manager for each request to customize its request header let urlSession = createURLSession() urlSessionStore[urlSessionId] = urlSession - + let parameters: [String: Any] = self.parameters ?? [:] - + let fileKeys = parameters.filter { $1 is URL } .map { $0.0 } - + let encoding: ParameterEncoding if fileKeys.count > 0 { encoding = FileUploadEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:)) @@ -121,29 +121,29 @@ open class URLSessionRequestBuilder: RequestBuilder { } else { encoding = URLEncoding() } - + guard let xMethod = HTTPMethod(rawValue: method) else { fatalError("Unsuported Http method - \(method)") } - + let cleanupRequest = { urlSessionStore[urlSessionId] = nil self.observation?.invalidate() } - + do { let request = try createURLRequest(urlSession: urlSession, method: xMethod, encoding: encoding, headers: headers) - + let dataTask = urlSession.dataTask(with: request) { [weak self] data, response, error in - + guard let self = self else { return } - + if let taskCompletionShouldRetry = self.taskCompletionShouldRetry { - + taskCompletionShouldRetry(data, response, error) { [weak self] shouldRetry in - + guard let self = self else { return } - + if shouldRetry { cleanupRequest() self.execute(apiResponseQueue, completion) @@ -159,18 +159,18 @@ open class URLSessionRequestBuilder: RequestBuilder { } } } - + if #available(iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0, *) { observation = dataTask.progress.observe(\.fractionCompleted) { newProgress, _ in self.progress.totalUnitCount = newProgress.totalUnitCount self.progress.completedUnitCount = newProgress.completedUnitCount } - + onProgressReady?(progress) } - + dataTask.resume() - + } catch { apiResponseQueue.async { cleanupRequest() @@ -179,7 +179,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } } - + fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -199,52 +199,52 @@ open class URLSessionRequestBuilder: RequestBuilder { switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is URL.Type: do { - + guard error == nil else { throw DownloadException.responseFailed } - + guard let data = data else { throw DownloadException.responseDataMissing } - + let fileManager = FileManager.default 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: httpResponse.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(.success(Response(response: httpResponse, body: filePath as? T))) - + } catch let requestParserError as DownloadException { completion(.failure(ErrorResponse.error(400, data, requestParserError))) } catch let error { completion(.failure(ErrorResponse.error(400, data, error))) } - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + default: - + completion(.success(Response(response: httpResponse, body: data as? T))) } @@ -258,7 +258,7 @@ open class URLSessionRequestBuilder: RequestBuilder { return httpHeaders } - fileprivate func getFileName(fromContentDisposition contentDisposition: String?) -> String? { + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { guard let contentDisposition = contentDisposition else { return nil @@ -277,7 +277,7 @@ open class URLSessionRequestBuilder: RequestBuilder { filename = contentItem return filename? - .replacingCharacters(in: range, with: "") + .replacingCharacters(in: range, with:"") .replacingOccurrences(of: "\"", with: "") .trimmingCharacters(in: .whitespacesAndNewlines) } @@ -286,7 +286,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getPath(from url: URL) throws -> String { + fileprivate func getPath(from url : URL) throws -> String { guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { throw DownloadException.requestMissingPath @@ -300,7 +300,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } - fileprivate func getURL(from urlRequest: URLRequest) throws -> URL { + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { guard let url = urlRequest.url else { throw DownloadException.requestMissingURL @@ -311,7 +311,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } -open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { +open class URLSessionDecodableRequestBuilder: URLSessionRequestBuilder { override fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, Error>) -> Void) { if let error = error { @@ -331,28 +331,28 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui switch T.self { case is String.Type: - + let body = data.flatMap { String(data: $0, encoding: .utf8) } ?? "" - + completion(.success(Response(response: httpResponse, body: body as? T))) - + case is Void.Type: - + completion(.success(Response(response: httpResponse, body: nil))) - + case is Data.Type: - + completion(.success(Response(response: httpResponse, body: data as? T))) - + default: - + guard let data = data, !data.isEmpty else { completion(.failure(ErrorResponse.error(httpResponse.statusCode, nil, DecodableRequestBuilderError.emptyDataResponse))) return } - + let decodeResult = CodableHelper.decode(T.self, from: data) - + switch decodeResult { case let .success(decodableObj): completion(.success(Response(response: httpResponse, body: decodableObj))) @@ -363,10 +363,10 @@ open class URLSessionDecodableRequestBuilder: URLSessionRequestBui } } -private class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { - +fileprivate class SessionDelegate: NSObject, URLSessionDelegate, URLSessionDataDelegate { + var credential: URLCredential? - + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { @@ -409,13 +409,13 @@ public protocol ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest } -private class URLEncoding: ParameterEncoding { - func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { - +fileprivate class URLEncoding: ParameterEncoding { + func encode(_ urlRequest: URLRequest, with parameters: [String : Any]?) throws -> URLRequest { + var urlRequest = urlRequest - + guard let parameters = parameters else { return urlRequest } - + guard let url = urlRequest.url else { throw DownloadException.requestMissingURL } @@ -424,12 +424,12 @@ private class URLEncoding: ParameterEncoding { urlComponents.queryItems = APIHelper.mapValuesToQueryItems(parameters) urlRequest.url = urlComponents.url } - + return urlRequest } } -private class FileUploadEncoding: ParameterEncoding { +fileprivate class FileUploadEncoding: ParameterEncoding { let contentTypeForFormPart: (_ fileURL: URL) -> String? @@ -440,13 +440,13 @@ private class FileUploadEncoding: ParameterEncoding { func encode(_ urlRequest: URLRequest, with parameters: [String: Any]?) throws -> URLRequest { var urlRequest = urlRequest - + guard let parameters = parameters, !parameters.isEmpty else { return urlRequest } - + let boundary = "Boundary-\(UUID().uuidString)" - + urlRequest.setValue("multipart/form-data; boundary=\(boundary)", forHTTPHeaderField: "Content-Type") for (key, value) in parameters { @@ -486,10 +486,10 @@ private class FileUploadEncoding: ParameterEncoding { fatalError("Unprocessable value \(value) with key \(key)") } } - + var body = urlRequest.httpBody.orEmpty - body.append("--\(boundary)--") + body.append("\r\n--\(boundary)--\r\n") urlRequest.httpBody = body @@ -501,40 +501,59 @@ private class FileUploadEncoding: ParameterEncoding { var urlRequest = urlRequest var body = urlRequest.httpBody.orEmpty - + let fileData = try Data(contentsOf: fileURL) let mimetype = self.contentTypeForFormPart(fileURL) ?? mimeType(for: fileURL) let fileName = fileURL.lastPathComponent + // If we already added something then we need an additional newline. + if (body.count > 0) { + body.append("\r\n") + } + + // Value boundary. body.append("--\(boundary)\r\n") - body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n\r\n") - body.append("Content-Type: \(mimetype)\r\n\r\n") + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"; filename=\"\(fileName)\"\r\n") + body.append("Content-Type: \(mimetype)\r\n") + // Separate headers and body. + body.append("\r\n") + + // The value data. body.append(fileData) - - body.append("\r\n\r\n") - + urlRequest.httpBody = body return urlRequest } - + private func configureDataUploadRequest(urlRequest: URLRequest, boundary: String, name: String, data: Data) -> URLRequest { var urlRequest = urlRequest - + var body = urlRequest.httpBody.orEmpty + // If we already added something then we need an additional newline. + if (body.count > 0) { + body.append("\r\n") + } + + // Value boundary. body.append("--\(boundary)\r\n") - body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n\r\n") + // Value headers. + body.append("Content-Disposition: form-data; name=\"\(name)\"\r\n") + + // Separate headers and body. + body.append("\r\n") + + // The value data. body.append(data) - body.append("\r\n\r\n") - urlRequest.httpBody = body return urlRequest From 354f195ec09293cfd731b72e67c3cc977b8c0894 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Tue, 28 Apr 2020 10:37:31 +0200 Subject: [PATCH 25/25] [typescript-fetch] Support deepObject query params (#6075) deepObject query parameters need to be specially marshalled. Unfortunately, they're quite tricky to distinguish in mustache because there's no boolean property for deepObject, so add a vendorExtension property to ease the mustache template. --- .../languages/TypeScriptFetchClientCodegen.java | 14 ++++++++++++++ .../main/resources/typescript-fetch/apis.mustache | 5 +++++ 2 files changed, 19 insertions(+) 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 38b3f71ac6..85ac755a42 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 @@ -236,9 +236,23 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege this.addOperationObjectResponseInformation(operations); this.addOperationPrefixParameterInterfacesInformation(operations); this.escapeOperationIds(operations); + this.addDeepObjectVendorExtension(operations); return operations; } + private void addDeepObjectVendorExtension(Map operations) { + Map _operations = (Map) operations.get("operations"); + List operationList = (List) _operations.get("operation"); + + for (CodegenOperation op : operationList) { + for (CodegenParameter param : op.queryParams) { + if (param.style != null && param.style.equals("deepObject")) { + param.vendorExtensions.put("x-codegen-isDeepObject", true); + } + } + } + } + private void escapeOperationIds(Map operations) { Map _operations = (Map) operations.get("operations"); List operationList = (List) _operations.get("operation"); diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index ace07d5b96..39ed958da2 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -122,7 +122,12 @@ export class {{classname}} extends runtime.BaseAPI { queryParameters['{{baseName}}'] = (requestParameters.{{paramName}} as any).toISOString().substr(0,10); {{/isDate}} {{^isDate}} + {{#vendorExtensions.x-codegen-isDeepObject}} + queryParameters['{{baseName}}'] = runtime.querystring(requestParameters.{{paramName}} as unknown as runtime.HTTPQuery, '{{baseName}}'); + {{/vendorExtensions.x-codegen-isDeepObject}} + {{^vendorExtensions.x-codegen-isDeepObject}} queryParameters['{{baseName}}'] = requestParameters.{{paramName}}; + {{/vendorExtensions.x-codegen-isDeepObject}} {{/isDate}} {{/isDateTime}} }